EN
JavaScript - get supported min integer value
3 points
In this article, we would like to show you how to get supported min integer value in JavaScript.
Quick solution:
JavaScript supports 53 bits integer numbers when we work on number type.
-9007199254740991
(in dec)===
-11111111111111111111111111111111111111111111111111111
(in bin)
xxxxxxxxxx
1
const minValue = Number.MIN_SAFE_INTEGER; // -9007199254740991
In this example, we print in the console the Number.MIN_SAFE_INTEGER
constant that represents the minimum safe integer in JavaScript.
xxxxxxxxxx
1
console.log(Number.MIN_SAFE_INTEGER); // -9007199254740991
Output:
xxxxxxxxxx
1
-9007199254740991