var test = JSON.parse('{ "name":"John", "age":30, "city":"New York"}');
console.log('testing parsing', test);
i have used this sample josn to parse but i am unable to parse.
Can anyone help me to get it right.
Thanks in advance
Best Answerthats because it is an object. you need to specify what exactly you want to see.
try
console.log('testing parsing', test.name);
Best Answer...or you could try console.log(JSON.stringify(test)) if you don't mind going around in a circle. 🙂
I'm also not convinced that " are beneficial around object attribute names; eg, for "name".
Best Answer