This site is mobile accessible. Press the "Tap Here" button to use a different font-size.


Smartphone icons created by Freepik - Flaticon

Convert a JSON string into a JavaScript object.

// create myJSON array literal
const myJSON = '{"name":"John", "age":31, "city":"New York"}';

// create myObj JS object
const myObj = JSON.parse(myJSON);

// display myObj.name
document.getElementById("demo").innerHTML = myObj.name;