Languages
[Edit]
EN

JavaScript - max Number value

10 points
Created by:
Wiktor-Sribiew
800

JavaScript API provides predefined constants that represent maximal positive possible Number values.

JavaScript number type combines together integer and floating-point values - Virtual Machine decides how to keep the numbers.

PropertyValueDescription
Number.MAX_SAFE_INTEGER9007199254740991Math.pow(2, 53) - 1
Number.MAX_VALUE1.7976931348623157e+308 
Number.POSITIVE_INFINITYInfinity1/0

Note: for larger integer numbers use BigInt.

Practical example:

// ONLINE-RUNNER:browser;

console.log(Number.MAX_SAFE_INTEGER);  // 9007199254740991
console.log(Number.MAX_VALUE);         // 1.7976931348623157e+308
console.log(Number.POSITIVE_INFINITY); // Infinity
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