Number.MAX_SAFE_INTEGER
is the largest integer which can be used safely in calculations.
For example, Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2
is true — any integer larger than MAX_SAFE_INTEGER cannot always be represented in memory accurately. All bits are used to represent the digits of the number.
Number.MAX_VALUE
on the other hand is the largest number possible to represent using a double precision floating point representation. Generally speaking, the larger the number the less accurate it will be.
More information double-precision floating point numbers on Wikipedia
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…