bhylu.com

Advertisements

JSON Syntax

JSON requires double-quoted property names and string values. It does not allow comments or trailing commas.

Where to run this

This example uses the JavaScript console playground. Select Run to execute it; the example does not run on this lesson page.

A practical example

JavaScript

const valid = '{"title":"Repair club","open":true}';
console.log(JSON.parse(valid).open);

What happens

The valid text parses to an object with open set to true.