Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS DSA TYPESCRIPT ANGULAR ANGULARJS GIT POSTGRESQL MONGODB ASP AI R GO KOTLIN SASS VUE GEN AI SCIPY CYBERSECURITY DATA SCIENCE INTRO TO PROGRAMMING BASH RUST

Basic JavaScript

JS Tutorial JS Introduction JS Where To JS Output JS Syntax JS Statements JS Comments JS Variables JS Data Types JS Let JS Const JS Operators JS Arithmetic JS Assignment JS Comparisons JS If Else JS Switch JS Loops JS Break JS Continue JS Functions JS Objects JS Events JS Strings JS String Templates JS Numbers JS Arrays JS Dates JS Math JS Booleans JS Logical JS RegExp JS Errors JS Scope JS Hoisting JS Strict Mode JS Code Blocks JS UTF-8 Characters

JS Advanced

JS Versions JS Overwiew JS Data Types JS String Methods JS Number Methods JS Date Methods JS Array Methods JS Functions JS Objects JS Classes JS Sets JS Maps JS Loops JS RegExp JS Promises JS Programming JS HTML DOM JS Windows JS Web API JS AJAX JS JSON JS jQuery JS Graphics JS Examples

JS References

JavaScript Objects


JavaScript Number Properties


JavaScript EPSILON

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

Example

let x = Number.EPSILON;
Try it Yourself »

Note

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

let x = Number.MAX_VALUE;
Try it Yourself »

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

let x = 6;
x.MAX_VALUE
Try it Yourself »

JavaScript MIN_VALUE

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

Example

let x = Number.MIN_VALUE;
Try it Yourself »

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

let x = Number.MIN_SAFE_INTEGER;
Try it Yourself »

JavaScript MAX_SAFE_INTEGER

Number.MAX_SAFE_INTEGER represents the maximum safe integer in JavaScript.

Number.MAX_SAFE_INTEGER is (253 - 1).

Example

let x = Number.MAX_SAFE_INTEGER;
Try it Yourself »


JavaScript POSITIVE_INFINITY

Example

let x = Number.POSITIVE_INFINITY;
Try it Yourself »

POSITIVE_INFINITY is returned on overflow:

let x = 1 / 0;
Try it Yourself »

JavaScript NEGATIVE_INFINITY

Example

let x = Number.NEGATIVE_INFINITY;
Try it Yourself »

NEGATIVE_INFINITY is returned on overflow:

let x = -1 / 0;
Try it Yourself »

JavaScript NaN - Not a Number

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

Examples

let x = Number.NaN;
Try it Yourself »

Trying to do arithmetic with a non-numeric string will result in NaN (Not a Number):

let x = 100 / "Apple";

Try it Yourself »

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:

W3Schools' Full JavaScript Reference.

The reference inludes all JavaScript updates from 1999 to 2025.



×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Copyright 1999-2025 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.