var str = '{"hello":"world"}';
try {
var obj = JSON.parse(str); // this is how you parse a string into JSON
document.body.innerHTML += obj.hello;
} catch (ex) {
console.error(ex);
}
// You have a JSON string
let myString = "{'foo': 'bar'}"
// You want it to become a JSON object
let myJSONObject = JSON.parse(myString);
// Now you have a JSON object and can access its properties
console.log(myJSONObject.property);