JSON
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.
Syntax
JSON.staticMethod();
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:
JSON
- .parse()
- Returns a new value taken from a provided JSON string.
- .stringify()
- Returns the string representation of a JSON object.
All contributors
- YanisaHS34 total contributions
- BrandonDusch580 total contributions
Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.