Hacker News new | ask | show | jobs
by postalrat 1942 days ago
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.
1 comments

> 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.