Explore JSON and how you can get JSON data as a JavaScript Object

Explore JSON and how you can get JSON data as a JavaScript Object

The JavaScript JSON Object

Explore JSON and how you can get JSON data as a JavaScript Object  

JSON is a language independent data format which was derived from JavaScript objects.  JSON is the most commonly used data format on the web, with many modern programming languages able to use it. JSON (JavaScript Object Notation)

JavaScript has an object called JSON which can be used to parse a string JSON structured value, into a JavaScript Object.  There are two method properties within the JSON object, one to parse a string into an object, the other to convert an object into a JSON structured string.

const myStr = ‘{“first”:”Laurence”,”last”:”Svekis”}’;

const myObj = JSON.parse(myStr);

console.log(myStr);

console.log(myObj);

Leave a Comment