Missing curly braces in JSON

A JSON object starts with { and ends with }, and its keys and values go in between. When you copy a few lines out of a bigger object, like a log entry or an API response, the braces usually stay behind. Without them, "name": "Ada Lovelace" is a string followed by more text. A parser reads "name" as the whole JSON and stops at the colon, because nothing but whitespace can follow a complete value.

In Chrome and Node.js, JSON.parse says: Unexpected non-whitespace character after JSON at position 6

Broken
"name": "Ada Lovelace",
"born": 1815,
"tags": ["math", "poetry"]
Fixed
{
  "name": "Ada Lovelace",
  "born": 1815,
  "tags": ["math", "poetry"]
}

Fix it by hand

Add a { before the first key and a } after the last value, and remove any comma after the last value.

Open this example in j2n