Example: Is the following code valid against the JSON Spec?
{
precision: \"zip\"
}
Or should I always use the following syntax? (And if
Yes they do. But if you need otherwise, checkout JSON5.
JSON5 is a superset of JSON that allows ES5 syntax, including:
The JSON5 reference implementation (json5 npm package) provides a JSON5
object that has parse
and stringify
methods with the same args and semantics as the built-in JSON
object.