Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

JSON.stringify and JSON.parse? They're standard library functions that many languages have, I don't see what's ES6 about them, they're much older.

First class treatment would be if the language had JSON-typed objects with functionality, e.g. something like

    const myJson = j'{"key":"value"}';
    const value = myJson['key'];
    const newJson = myJson.set("otherkey", "newValue");
(using the j'' notation for a hypothetical json-typed value)

But AFAIK it doesn't, not even in ES6.



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.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: