2 ms·
Sadly the reviver parameter is a new invention only recently available in FF and Node, not at all in Safari. Naturally not that hard to write a custom JSON par
by whizzter 2y ago
Sadly the reviver parameter is a new invention only recently available in FF and Node, not at all in Safari.
Naturally not that hard to write a custom JSON parser but the need itself is a bad thing.
- hajile 2y agoJust use the polyfill https://github.com/zloirock/core-js#jsonparse-source-text-access https://github.com/zloirock/core-js#jsonparse-source-text-ac...
- arnorhs 2y agoNo it's been there for ages. Finalized as part of ecmascript 5 What you are probably thinking of is the context parameter of the reviver callback. That is relatively recent and mostly a qol improvement
- whizzter 2y agoSorry yes, i was thinking of the context object with source parameter. The issue it solves is a big one though, since without it the JSON.parse functionality cannot parse numbers that are larger than 64bit float numbers (f.ex. bigints).