DEV Community

Sleepless Yogi
Sleepless Yogi

Posted on

What is the largest number in JavaScript?

Top comments (1)

Collapse
 
caiangums profile image
Ilê Caian

Hey! I noticed that this is a simple question to answer!

In matter of fact, JavaScript has a very good API for the Math operations, and even for Numbers. You can discover:

// Largest Possible Positive Number
Number.MAX_VALUE = 1.7976931348623157e+308

// Largest Possible Integer Positive Number
Number.MAX_SAFE_INTEGER = 9007199254740991

// Lowest Possible Positive Number (something like `0,000...005`)
Number.MIN_VALUE = 5e-324

// Lowest Possible Negative Number
Number.MIN_SAFE_VALUE = -9007199254740991

Higher or lowest numbers than that are represented as

Number.POSITIVE_INFINITY = Infinity
Number.NEGATIVE_INFINITY = -Infinity

Hope that solves your mistery!