|
|
|
|
|
by k3n
3755 days ago
|
|
Can you provide some more context? > JSON.stringify(1)
"1"
Stored without a decimal for free, seems like it'd be up to the receiver to interpret it correctly.What if you receive it in JS? JSON.parse(JSON.stringify(1))
> 1
Ok, so it parses an int for free too... thus my confusion.Regardless, you can still override anything it does considering the second argument to both `JSON.parse()` and `JSON.stringify()` allows you to provide your own function for handling the logic as you see fit. |
|
JSON doesn't support integers for example on my 64bit system it can't support INT_MAX as a value and anything greater then 9007199254740993 might just come out as wrong.