3 ms·
My best story of this is JS integer parsing - we were passing IDs to the frontend through C# as ints, parsed by JS on the frontend from the JSON HTTP response.
by e_i_pi_2 4y ago
My best story of this is JS integer parsing - we were passing IDs to the frontend through C# as ints, parsed by JS on the frontend from the JSON HTTP response. We spent at least a day trying to figure out why our links weren't working and it was because our numbers were too big for JS
In a browser console it drops off after 16 digits and right-pads with zeros
> 11111111111111111111
> 11111111111111110000
Our solution was to pass all IDs as strings because they aren't ever going to be manipulated like a number will