Open Playground
JS TutorialLesson #36

JavaScript Number Properties

let x = Number.EPSILON;

See Also: > Numbers Tutorial > Number Methods > Number Reference

JavaScript EPSILON

Number.EPSILON is the difference between the smallest floating point number greater than 1 and 1.

Example

Example Code

javascript
Try it Yourself
let x = Number.EPSILON;
Number.EPSILON is an ES6 feature. > It does not work in Internet Explorer.

JavaScript MAX_VALUE

Number.MAX_VALUE is a constant representing the largest possible number in JavaScript.

Example

Example Code

javascript
Try it Yourself
let x = Number.MAX_VALUE;
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:

Example

Example Code

javascript
Try it Yourself
let x = 6;

x.MAX_VALUE

JavaScript MIN_VALUE

Number.MIN_VALUE is a constant representing the lowest possible number in JavaScript.

Example

Example Code

javascript
Try it Yourself
let x = Number.MIN_VALUE;

Minimum and Maximum Safe Integers

ES6 added max and min properties to the Number object:

  • Number.MAX_SAFE_INTEGER
  • Number.MIN_SAFE_INTEGER

JavaScript MIN_SAFE_INTEGER

Number.MIN_SAFE_INTEGER represents the minimum safe integer in JavaScript.

Number.MIN_SAFE_INTEGER is -(253 - 1).

Example

Example Code

javascript
Try it Yourself
let x = Number.MIN_SAFE_INTEGER;

JavaScript MAX_SAFE_INTEGER

Number.MAX_SAFE_INTEGER represents the maximum safe integer in JavaScript.

Number.MAX_SAFE_INTEGER is (253 - 1).

Example

Example Code

javascript
Try it Yourself
let x = Number.MAX_SAFE_INTEGER;

JavaScript POSITIVE_INFINITY

Example

Example Code

javascript
Try it Yourself
let x = Number.POSITIVE_INFINITY;

JavaScript NEGATIVE_INFINITY

Example

Example Code

javascript
Try it Yourself
let x = Number.NEGATIVE_INFINITY;

JavaScript NaN - Not a Number

NaN is a JavaScript reserved word for a number that is not a legal number.

Examples

Example Code

javascript
Try it Yourself
let x = Number.NaN;
Safe integers are all integers from -(253 - 1) to +(253 - 1). > This is safe: 9007199254740991. This is not safe: 9007199254740992.

Complete JavaScript Reference > For a complete reference to all JavaScript properties and methods, with full descriptions and many examples, go to: > EA Academy' Full JavaScript Reference. > The reference inludes all JavaScript updates from 1999 to 2025.


Interactive Code Examples

JS Example 1

javascript
Try it Yourself
JavaScript syntax and algorithm demonstration.
let x = Number.EPSILON;

JS Example 2

javascript
Try it Yourself
JavaScript syntax and algorithm demonstration.
let x = Number.MAX_VALUE;

JS Example 3

javascript
Try it Yourself
JavaScript syntax and algorithm demonstration.
let x = 6;

x.MAX_VALUE

JS Example 4

javascript
Try it Yourself
JavaScript syntax and algorithm demonstration.
let x = Number.MIN_VALUE;

JS Example 5

javascript
Try it Yourself
JavaScript syntax and algorithm demonstration.
let x = Number.MIN_SAFE_INTEGER;

JS Example 6

javascript
Try it Yourself
JavaScript syntax and algorithm demonstration.
let x = Number.MAX_SAFE_INTEGER;