Number

The Number object has some helpful read-only properties.

Properties

MAX_VALUE

FF, IE 4

Read-only: Highest integer possible given the configuration of the browser and the computer it's on

MIN_VALUE

FF, IE 4

Read-only: Lowest integer possible given the configuration of the browser and the computer it's on

NaN

FF, IE 4

Read-only: Not a number, the result if a mathematical operation fails (Math.sqrt(-1), for example); can be tested with the isNaN() function

Example:

if (isNaN(Math.sqrt(-1)))
{
    alert("Get real! You can't take the square root of −1!");
}

NEGATIVE_INFINITY

FF, IE 4

Read-only: Value smaller than Number.MIN_VALUE. You know no number will ever be less than this value.

POSITIVE_INFINITY

FF, IE 4

Read-only: Value bigger than Number.MAX_VALUE. No number ...

Get The Book of JavaScript, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.