3 ms·
An integer suffixed with the letter "n" is not valid JSON and will not parse if you follow the spec. The "n" suffix is how you write BigInts in JavaScript, not
by thedufer 8y ago
An integer suffixed with the letter "n" is not valid JSON and will not parse if you follow the spec. The "n" suffix is how you write BigInts in JavaScript, not JSON.
- Spivak 8y agoHow JS chooses to show the string interpretation of the datatype has nothing to do with whether you can map the type into an abstract JSON number, which you can. JSON.stringify(1n) === "1" JSON.stringify(100000000000000000000n) === "100000000000000000000"