JavaScript JSON.parse() Explained

JavaScript Logo

JSON.parse() – Parses a JSON string and constructs the JavaScript value or object described by it.

๐Ÿ‘‰ Syntax

JSON.parse(text[, reviver])

๐Ÿงช Example

const json = '{"name":"Bob"}';
const obj = JSON.parse(json);
console.log(obj.name);

Comments