JavaScript Tutorial

The language for programming web pages.

JS JSON

JavaScript JSON

JSON stands for JavaScript Object Notation. JSON is a lightweight format for storing and transporting data. JSON is often used when data is sent from a server to a web page.

Key Methods:

  • JSON.stringify(obj) — Convert JS object to JSON string
  • JSON.parse(str) — Convert JSON string to JS object

Rules:

  • Keys must be strings in double quotes
  • Values: string, number, boolean, null, array, object
  • No trailing commas, no comments
  • No undefined or functions

Try It Yourself

Edit the code below and click Run to see the result live.

Source Code
Result
Topics