- Home
- /
- Tutorials
- /
- JavaScript Tutorial
- /
- JavaScript JSON
JavaScript Objects
JavaScript JSON
JSON is a text format for data, and JavaScript can convert objects to and from it.
JSON.stringify turns an object into a string.
JSON.parse turns that string back into an object.
Example
Example
javascript
const person = { name: "Ada", age: 36 };
const text = JSON.stringify(person);
console.log(text);The output is a string containing the object's data.
