> parseInt("10765432100123456789") 10765432100123458000
Number.MAX_SAFE_INTEGER constant and
MAX_SAFE_INTEGERconstant has a value of
floating-point format 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 represent integers
exactly and to correctly compare them. For example,
Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2will
true, which is mathematically incorrect. See
Number.isSafeInteger()for more information.
A “pure string” representation is what OData specifies, for its
What the Twitter API does in this case, is to add a specific
".._str": field in the JSON, as such:
I like this option very much, since it would be still compatible with int64 capable clients. In practice, such duplicated content in the JSON won’t hurt much, if it is deflated/gzipped at HTTP level.