0 votes
in JSON by
What is the use of JSON.parse in JavaScript?

1 Answer

0 votes
by

It is used to parse the data present inside the JSON into objects for using its values.

The syntax used to parse JSON data:

string json = ‘{

"Brand": "Hyundai",

"Name": "Verna",

"Color": “Red”

}’

var obj = JSON.parse(json);

This will convert JSON data into the object from which we can retrieve the data for use with the application.

...