Quick answer: Construct 3 Array.LoadJSON returning rounded values for numbers above 2^53? JavaScript JSON parser is IEEE 754 - encode large IDs as strings, not numbers.
Player ID 9007199254740993 saved to JSON; loads back as 9007199254740992. Save corruption.
Encode as string
{ "playerId": "9007199254740993" }String round-trips losslessly. Parse to BigInt or keep as string in code.
Or use two integers
Split into high/low 32-bit halves. Both safe in IEEE 754; reassemble on load.
Validate range at write
If any number exceeds the safe range, log a warning. Catches the bug class before it ships.
“JSON numbers are doubles. Doubles lose precision past 2^53.”
If you have any 64-bit IDs (timestamps, UUIDs as numbers, user IDs), encode as strings. The precision cliff doesn't surface in dev with small test data.