JavaScript Number Properties


The JavaScript Number object may represent numeric values such as integer, float, hexadecimal, decimal, and so on. It serves as a container for primitive numeric values.

It has a number of methods and properties that can be used to perform various tasks on numbers. The table below shows some static Number object properties that can be used as constants throughout a program.

Property Description
EPSILON The difference between 1 and the smallest JS number.
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

1. EPSILON

The difference between 1 and the smallest JS number.

Example

Preview

2. MAX_VALUE

It returns the largest numeric value that JavaScript supports.

Example

Preview

3. MIN_VALUE

It provides the lowest positive integer that is closest to zero, but not the largest negative number.

Example

Preview

4. NEGATIVE_INFINITY

It depicts the inverse of infinity.

Example

Preview

5. POSITIVE_INFINITY

It denotes a positive infinity value.

Example

Preview

6. MAX_SAFE_INTEGER

In JavaScript, it represents the largest safe integer.

Example

Preview

7. MIN_SAFE_INTEGER

In JavaScript, it represents the smallest safe integer.

Example

Preview

8. NaN

It is used to represent values that are not legal numbers.

Example

Preview