Languages
[Edit]
EN

JavaScript - get max supported integer value

3 points
Created by:
MindOfMadness3
696

In this article, we would like to show you how to get supported max integer value in JavaScript.

Quick solution:

JavaScript supports 53 bits integer numbers when we work on number type.

9007199254740991 (in dec) === 11111111111111111111111111111111111111111111111111111 (in bin)

const maxValue = Number.MAX_SAFE_INTEGER;  // 9007199254740991

 

Practical example

In this example, we print in the console the Number.MAX_SAFE_INTEGER constant that represents the maximum safe integer in JavaScript.

// ONLINE-RUNNER:browser;

console.log(Number.MAX_SAFE_INTEGER);  // 9007199254740991

Output:

9007199254740991

 

See also

  1. JavaScript - get supported min integer value

Alternative titles

  1. JavaScript - max integer value
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join