When I execute
parseInt(8558968890839370929)
in Chrome, it returns 8558968890839371000
. Why does it not return 9,007,199,254,740,992
(253) instead?
When I execute
parseInt(8558968890839370929)
in Chrome, it returns 8558968890839371000
. Why does it not return 9,007,199,254,740,992
(253) instead?
Because the range of int is crossed. The maximum value of int can be +/- 9007199254740992
From the ECMA
Note that all the positive and negative integers whose magnitude is no greater than 253 are representable in the Number type (indeed, the integer 0 has two representations, +0 and −0).