Mon Aug 03 2026 • tutorials javascript json serialization … is lying to you Run this in your browser console: const payload = { id: 9007199254740993 } console.log(JSON.stringify(payload)) // {“id”:9007199254740992} The value ends in 3, but the serialized result ends in 2. Nothing throws, and the output remains valid JSON, so the change is easy to miss when the value is an identifier buried inside a larger payload. Now try a more varied object: const original = { id: 9007199254740993, missing: undefined, createdAt: new Date(‘2026-07-21T12:00:00Z’), score: NaN } const copy = JSON.parse(JSON.stringify(original)) console.log(copy) // { // id: 9007199254740992, // createdAt: “2026-07-21T12:00:00.000Z”, // score: null // } The number changed, the missing…
Your JSON Is Lying to You
Advertisement