Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Web Technology by (7k points)

How can I parse Json in JavaScript?

1 Answer

0 votes
by (13.1k points)

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);

Want to be a full stack developer? Check out the full stack developer course from Intellipaat. 

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Jan 21, 2021 in Web Technology by dev_sk2311 (45k points)

Browse Categories

...