Skip to content

Try our new Crash Courses!

Buy one of our new Crash Courses, now hosted on Podia.

JSON – JavaScript

Summary

JSON syntax:

{
  "string": "Hello world",
  "boolean": true,
  "number": 1234,
  "negativeNumber": -1234,
  "fraction": 0.1234,
  "exponent": 1234e+5,
  "negativeExponent": 1234e-5,
  "array": [
    "Hello world",
    true,
    1234
  ],
  "object": {
    "string": "Hello world",
    "boolean": true,
    "number": 1234,
    "array": [
      "Hello world",
      true,
      1234
    ]
  }
}

Details

In JSON, all properties and string values should be wrapped in double quotes.

Exercises

There are no exercises for this lesson.

References

Introducing JSON

Working with JSON on MDN

JSON on MDN

Back to: JavaScript Reference > JS Other