JSON vs JavaScript
What this is
JSON is a data format, not JavaScript. Copy-paste from a .js file fails because of unquoted keys, single quotes, trailing commas, undefined, NaN, Infinity, functions, and comments. Repair handles the mechanical cases. JSON.stringify drops undefined keys and turns Date into ISO strings — that is serialization, not a round-trip of the original object graph.
Open the formatter — paste stays in this tab.
FAQ
- undefined in arrays?
- JSON.stringify turns array holes and undefined elements into null.