isFinite() (Function/global)

Test a numeric value for infinity.

Availability:

ECMAScript edition - 2
JavaScript - 1.3
JScript - 3.0
Internet Explorer - 4.0
Netscape - 4.06
Property/method value type:Boolean primitive
JavaScript syntax:-isFinite(aValueToTest)
Argument list:aValueToTestA numeric value to check for validity

This is a built-in function to check for the infinity value. Because it is a member of the Global object, and the Global object is permanently in the prototype inheritance chain, you don't need to identify which object the function belongs to.

Applies the internal ToNumber operator to its argument, then returns true or false depending on whether the value is a finite number or not.

The result is true for a valid and finite numeric value and false if the value is NaN or one of the Infinities.

Warnings:

See also:Enquiry functions, Function property, Global object, Infinity, Special type, ToNumber

Property attributes:

DontEnum

Cross-references:

ECMA 262 edition 2 - section - 15.1.2.7

ECMA 262 edition 3 - section - 15.1.2.5