What causes the error in the following code snippet?
//Code
JSON.parse("{'name':'Khushal Khan'}");
leading to this error message:
//Response
SyntaxError: Unexpected token '
But why does this version work flawlessly?
//Code
JSON.parse('{"name":"Khushal Khan"}');
Expected Output:
//Response
Object {name: "Khushal Khan"}