JSON

In JavaScript, the reserved JSON object is used to convert values to JavaScript Object Notation (JSON). It can also be used for parsing JSON values.

Syntax

JSON.staticMethod();

The .staticMethod() used against the JSON object is going to be either the .parse() or the .stringify() methods, shown below:

JSON

.parse()
Returns a new value taken from a provided JSON string.
.stringify()
Returns the string representation of a JSON object.
Edit this page on GitHub

Contributors

Interested in helping build Docs? Read the Contribution Guide or share your feedback form.

Learn JavaScript on Codecademy