|
|
|
|
|
by galaxyLogic
20 days ago
|
|
> JSON is literally a subset of the JavaScript language Isn't it more like when you write JSON in JavaScript you write it as a String?
JavaScript has the data-type "String" but does it also have a built-in data-type "JSON"? You can pass such a string containing JSON to (built-in) library function JSON.parse() and you can take a data-structure written in JavaScript can call JSON.stringify() on it. But if your JSON is malformed, does the JS-interpreter tell you that, before you call the library-function JUSON.parse() ? If you have a JavaScript parser/interpreter, does it parse JSON too? If not I would say JSON is not part of the JavaScript language, even if JS runtime provides a library function for parsing it. |
|