The JavaScript Object Notation

JavaScript·2 min read·Jan 1, 2025

The JavaScript Object Notation (JSON) is a language-agnostic data format used to store collections of data in the form of key-value pairs, that is easy for humans to read and write, and easy for machines to parse and generate.

It is commonly used to create configuration files, exchange data between applications, or store data in databases.

Although relatively similar to object literals, JSON objects are only meant to store data and do not allow for computed property names or additional properties, such as methods.

The JSON syntax

Similar to object literals, JSON objects are declared using angle brackets:

variable = {};

JSON property keys must be enclosed in double quotes and properties themselves separated by comma characters:

{  "key": "value",  "key": value,  ...}

The JSON data types

JSON supports the following data types:

  • String: Enclosed in double quotes (e.g., "Hello").
  • Number: Integer or floating-point (e.g., 42, 3.14).

Unlock the program 🚀

Pay once, own it forever.

€79

30-day money-back guarantee

  • 13 modules
  • 113 lessons with full-code examples
  • 29 projects with commented solutions
  • All future lesson and project updates
  • Lifetime access

By submitting this form, you agree to the Terms & Conditions and Privacy Policy.