JavaScript parse JSON code example.
var json = '{ "first_name":"Tommy", "age":46 }';
var personObject = JSON.parse( json ); // parse JSON string into JavaScript object
console.log( personObject.first_name ); // Tommy
console.log( personObject.age ); // 46
Found this article interesting? Follow Brightwhiz on Facebook, Twitter, and YouTube to read and watch more content we post.