That would be because
9658921879781125 > Number.MAX_SAFE_INTEGER
Therefore, it is unsafe to try to work with numbers larger than Number.MAX_SAFE_INTEGER
The constant MAX_SAFE_INTEGER has the value 9007199254740991 (9 007 199 244 740 991 or ~ 9 quadrillion). The rationale for this number is that JavaScript uses double-precision floating-point numbers, as specified in IEEE 754, and can only safely represent numbers between - (2 53 - 1) and 2 53 - 1.
Safe in this context refers to the ability to accurately represent integers and correctly compare them .
Gaby aka G. petrioli
source share