目录

JavaScript MAX_SAFE_INTEGER

Example

let x = Number.MAX_SAFE_INTEGER;
Try it Yourself »

Description

Number.MAX_SAFE_INTEGER represents the maximum safe integer in JavaScript.

Number.MAX_SAFE_INTEGER is (253 - 1).


Number.MAX_SAFE_INTEGER

MAX_SAFE_INTEGER is a property of the JavaScript Number object.

You can only use it as Number.MAX_SAFE_INTEGER.

Using x.MAX_VALUE, where x is a variable, will return undefined:

Example

let x = 100;
x.MAX_SAFE_INTEGER;
Try it Yourself »

Syntax

Number.MAX_SAFE_INTEGER

Return Value

Type Description
Number 9007199254740991

Browser Support

Number.MAX_SAFE_INTEGER is an ECMAScript6 (ES6) feature.

ES6 (JavaScript 2015) is supported in all modern browsers:

Chrome Edge Firefox Safari Opera
Yes Yes Yes Yes Yes

Number.MAX_SAFE_INTEGER is not supported in Internet Explorer 11 (or earlier).