3 ms·
You're getting downvotes because what you've said is incorrect. This wouldn't be changing/violating/breaking the JSON format - it already allows for arbitrary p
by BillinghamJ 8y ago
You're getting downvotes because what you've said is incorrect. This wouldn't be changing/violating/breaking the JSON format - it already allows for arbitrary precision.
However changing the behaviour of `JSON.parse` would indeed be a breaking change. That's an issue with the JS spec and web compatibility - not with JSON. The solution there is simple - either make a new function with new rules or add the ability to pass in options to `JSON.parse`.
- olliej 8y agoThe spec breakage is that you’d need the n suffix to indicate it’s a bigint.
- BillinghamJ 8y agoNo, you wouldn't. You'd just put the number in without the "n". In JSON, an integer is an integer - there's no limit to its size and no need to specify whether the integer is big or small. The "n" notation is just to ensure compatibility within JS - has nothing to do with representing the number in JSON.