JSON.parse()
JSON.parse()
method converts the JSON
string into a JavaScript.
const json = '{"result":true, "count":42}'; const obj = JSON.parse(json); console.log(obj.count); // 42 console.log(obj.result); // true
Can return Object
, Array
, string
, number
, boolean
, or null
value corresponding to the given JSON text.