JavaScript has a built in function for converting JSON strings into JavaScript objects:
JSON.parse()
JavaScript also has a built in function for converting an object into a JSON string:
JSON.stringify()
Example of a JSON string:
'{"name":"John", "age":30, "car":"Ford"}'
The JSON format is syntactically similar to the code for creating JavaScript objects. Because of this, a JavaScript program can easily convert JSON data into JavaScript objects.
Since the format is text only, JSON data can easily be sent between computers, and used by any programming language.
Read this for more details https://www.w3schools.com/js/js_json_intro.asp
No comments:
Post a Comment