MAX_SAFE_INTEGER

The largest whole number, 9007199254740991, that a JavaScript number can store exactly.

In more detail

Beyond it, consecutive integers can no longer all be represented, so 9007199254740993 silently becomes 9007199254740992. IDs and counts that can grow larger should use bigint or strings.

Related terms

Taught in

References