Languages
[Edit]
EN

JavaScript - max Number value

10 points
Created by:
Wiktor-Sribiew
350

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
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