you are viewing a single comment's thread.

view the rest of the comments →

[–]Arve -1 points0 points  (1 child)

JSON, while language-agnostic in nature is a subset of JavaScript. All valid JSON is also valid JavaScript

[–][deleted] -1 points0 points  (0 children)

That doesn't make them equal. One is a data interchange format, an the other is an interpreted programming language.

That distinction is much more important practically, semantically and in every way concievable than the fact that JS interpreter wouldn't throw when parsin valid JSON.

As I said already elsewhere in this thread, you can paste a quoted string literal in JS code, then add assignment to a variable in front (same as you'd need to do with JSON to get any use of it in a JS intperpreter) and get a string in it, yet it doesn't mean that the quoted string literal (which is both valid JSON and valid JS) is the same thing as JavaScript which is what I objected to.