Back
How can I parse Json in JavaScript?
The standard method of parsing JSON in JavaScript is JSON.parse()
You can do something like this:
const json = '{ "fruit": "pineapple", "fingers": 10 }';const obj = JSON.parse(json);console.log(obj.fruit, obj.fingers);
const json = '{ "fruit": "pineapple", "fingers": 10 }';
const obj = JSON.parse(json);
console.log(obj.fruit, obj.fingers);
Want to be a full stack developer? Check out the full stack developer course from Intellipaat.
31k questions
32.8k answers
501 comments
693 users