Parsing a simple JSON string
suggest changeThe JSON.parse()
method parses a string as JSON and returns a JavaScript primitive, array or object:
const array = JSON.parse('[1, 2, "c", "d", {"e": false}]');
console.log(array); // logs: [1, 2, "c", "d", {e: false}]
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents