JSON (JavaScript)

JSON (JavaScript Object Notation) is a lightweight text format for storing and exchanging data. It looks like JavaScript objects and is the standard way APIs send data.

JavaScript

JSON uses key/value pairs and arrays, with keys in double quotes. It supports strings, numbers, booleans, null, arrays, and objects.

Although it grew out of JavaScript, JSON is language-independent and supported almost everywhere.

Examples

JavaScript

const data = '{ "name": "Ada", "age": 36 }';
const obj = JSON.parse(data);
console.log(obj.name);

Output:

Ada

See also

Back to the Dictionary