JSON: The JavaScript subset that isn't
From Wikipedia’s article on JSON
JSON was based on a subset of the JavaScript scripting language.
All JSON-formatted text is also syntactically legal JavaScript code.
JSON is a subset of JavaScript.
All these years we’ve heard it over and over again: “JSON is a JavaScript subset”. Guess what? They’re wrong. Wrong, wrong, wrong. You see, the devil’s in the details, and there’s no way to avoid it: Not all JSON-formatted text is legal JavaScript code:
{"JSON":"ro
cks!"}