What is JSON?
JSON (JavaScript Object Notation) is a lightweight, text-based format for representing structured data. It's how APIs send data over a network, how config files get written, and how you persist data to disk or localStorage.
Valid JSON values
JSON supports exactly six types: string, number, boolean, null, object, and array. Notably absent: undefined, functions, and comments, none of those exist in JSON.
JSON vs a JavaScript object literal
They look almost identical, but JSON is a text format: keys and string values must use double quotes, and it can't contain functions, undefined, Date objects, or comments. A JavaScript object literal has none of those restrictions, it's just code.