MAX_SAFE_INTEGERbeginner// Largest safely representable integer
Number.MAX_SAFE_INTEGER // β 9007199254740991
Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2 // β true (unsafe!)Use Number.MAX_SAFE_INTEGER as the upper bound when working with integers to avoid silent precision loss.
Number.MAX_SAFE_INTEGER equals 2^53 - 1 = 9007199254740991 β the largest integer that can be represented exactly.