Re:BigInt is finally here in ES2020
by postalrat on Monday March 01, 2021 @09:47PM
(#26311359)
Because bigints aren't part of the json spec? Like they said you create your own toJSON like: 'BigInt.prototype.toJSON = function() { return this.toString(); };' if you want to bend the spec.
[ Parent
| on HN ]
Re:BigInt is finally here in ES2020
by dragonwriter on Monday March 01, 2021 @10:09PM
(#26311470)
> Because bigints aren't part of the json spec?
Arbitrarily sized numbers (with no guarantee on supported range or precision in processors) are part of the spec, the problem is JS already serializes/deserializes them as Number and any change would break backwards compatibility.