Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Converting JSON to JavaScript Object

// json object
const jsonData = '{ "name": "John", "age": 22 }';

// converting to JavaScript object
const obj = JSON.parse(jsonData);

// accessing the data
console.log(obj.name); // John
Source by jonsuh.com #
 
PREVIOUS NEXT
Tagged: #Converting #JSON #JavaScript #Object
ADD COMMENT
Topic
Name
6+3 =