JavaScript Number Properties


Property Description
EPSILON The difference between 1 and the smallest number > 1.
MAX_VALUE The largest number possible in JavaScript
MIN_VALUE The smallest number possible in JavaScript
MAX_SAFE_INTEGER The maximum safe integer (253 - 1)
MIN_SAFE_INTEGER The minimum safe integer -(253 - 1)
POSITIVE_INFINITY Infinity (returned on overflow)
NEGATIVE_INFINITY Negative infinity (returned on overflow)
NaN A "Not-a-Number" value

JavaScript EPSILON

Number.EPSILON represents the tiny gap between the smallest floating point number larger than 1 and the number 1.

Note : Number.EPSILON is an ES6 feature.

It does not work in Internet Explorer.


JavaScript MAX_VALUE

In JavaScript, Number.MAX_VALUE stands for the biggest number you can have.


Number Properties Cannot be Used on Variables

Number properties belong to the JavaScript Number Object.

These properties can only be accessed as Number.MAX_VALUE.

Using x.MAX_VALUE, where x is a variable or a value, will return undefined:


JavaScript MIN_VALUE

In JavaScript, Number.MIN_VALUE is like the smallest number you can ever have. It doesn't change; it's always the tiniest number in JavaScript.


JavaScript MAX_SAFE_INTEGER

The code Number.MAX_SAFE_INTEGER in JavaScript stands for the largest whole number that can be used safely.

The Number.MAX_SAFE_INTEGER in HTML is equivalent to the number 2 to the power of 53 minus 1.


JavaScript MIN_SAFE_INTEGER

In JavaScript, Number.MIN_SAFE_INTEGER stands for the smallest whole number that can be safely used in your code.

The number known as Number.MIN_SAFE_INTEGER is equal to negative two to the power of 53, minus one.

Note : MAX_SAFE_INTEGER and MIN_SAFE_INTEGER are ES6 features.

They do not work in Internet Explorer.


JavaScript POSITIVE_INFINITY


JavaScript NEGATIVE_INFINITY


JavaScript NaN - Not a Number

NaN in JavaScript means a special kind of number that's not a valid number.