Javascript JSON parsing - Web Development

Javascript JSON parsing

Json is a text-based format like xml . JSON is easy to read and easy to understand for humans and computers but Json occupy less bandwith compare to xml . JSON is the most popular and lightweight data-interchange format for website applications. Below is json object.

We have seen Json object , Now below is Json array inside Json object

 

How to parse Json data in javascript

Lets suppose we have below data which we received from a server

Now we will use JSON.parse() method to convert this data into javascript object and access its value using dot symbol (.) See the below example

Output of code

Dheeraj
22222222
Jaipur

Leave a Reply

Your email address will not be published. Required fields are marked *