The JavaScript Number.MIN_SAFE_INTEGER is a constant number that represents the minimum safe integer. This constant has a value of (-(253 – 1)).
Use Number.MIN_SAFE_INTEGER, as a property of a number object because it is a static property of a number.
Syntax:
Number.MIN_SAFE_INTEGER
Return Value: Constant number.
Example 1: Below example illustrates the use of simple Number.MIN_SAFE_INTEGER property.
Javascript
const a = Number.MIN_SAFE_INTEGER - 1;
const b = Number.MIN_SAFE_INTEGER - 2;
console.log(Number.MIN_SAFE_INTEGER);
console.log(a);
console.log(a === b);
|
Output:
-9007199254740991
-9007199254740992
true
Example 2: Below example illustrates the usage of Number.MIN_SAFE_INTEGER property using Math.pow() function.
Javascript
const c = Number.MIN_SAFE_INTEGER;
const d = -(Math.pow(2, 53) - 1);
console.log(c);
console.log(d);
console.log(c === d);
|
Output:
-9007199254740991
-9007199254740991
true
Note: Internet explorer is not supported.
Supported Browsers:
- Chrome 34 and above
- Edge 12 and above
- Firefox 31 and above
- Opera 21 and above
- Safari 9 and above
We have a complete list of JavaScript Number constructor, properties, and methods list, to know more about the numbers please go through that article.