https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
Implementing j`{"key":"value"}`; as a tagged template literal is left as an exercise for the reader.
Implementing j`{"key":"value"}`; as a tagged template literal is left as an exercise for the reader.
First class treatment would be if the language had JSON-typed objects with functionality, e.g. something like
(using the j'' notation for a hypothetical json-typed value)But AFAIK it doesn't, not even in ES6.