JavaScript: JSON.parse

By Xah Lee. Date: . Last updated: .

JSON.parse(jsonStr)

Convert JSON string to a JavaScript value.

const xx = `{"a":3 , "b":[4,2]}`;

console.log(
  JSON.parse(xx),
);

// { a: 3, b: [ 4, 2 ] }
BUY
ΣJS
JavaScript in Depth

JS Obj Reference

JSON