Behind the scenes, is JSON created using eval?
If not, how does the string '{"val1":1,"val2":2}' get turned into an object where .val1 == 1 and .val2 == 2?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
JSON is usually converted into a JavaScript object using a JSON parser. Browsers nowadays come with one which can be accessed via the
parsemethod of theJSONobject. The traditional pollyfill is json2.js.That string, however, is not JSON and cannot be parsed with a JSON parser.