In JavaScript, the built-in JSON object is used to convert values to JavaScript Object Notation (JSON) as well as parse those values. JSON is a standard JavaScript object, so there is no need to import any external packages.



No constructor function is needed to create JSON objects. The .staticMethod() used against the JSON object is going to be either the .parse() or the .stringify() methods, shown below:


Returns a new value taken from a provided JSON string.
Returns the string representation of a JSON object.


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

Learn JavaScript on Codecademy