I am trying to learn JSON, i learned that any javascript object with the key in double quotes are considered as JSON object.
And i constructed this object
JSON.parse() accepts a string and converts to JSON object, it doesnt take a javascript object as the parameter. Refer JSON.parse() It could give you the results as follows
JSON.parse('{}'); // {}
JSON.parse('true'); // true
JSON.parse('"foo"'); // "foo"
JSON.parse('[1, 5, "false"]'); // [1, 5, "false"]
JSON.parse('null'); // null
and do know that If the string to parse is not valid JSON, a SyntaxError exception is thrown. so this is how you get syntax error on jstr1 (It is not a JSON string)