Visit Mozilla.org

Core JavaScript 1.5 Guide:Predefined Functions:isFinite Function

From MDC

[edit] isFinite Function

The isFinite function evaluates an argument to determine whether it is a finite number. The syntax of isFinite is:

isFinite(number)

where number is the number to evaluate.

If the argument is NaN, positive infinity or negative infinity, this method returns false, otherwise it returns true.

The following code checks client input to determine whether it is a finite number.

if(isFinite(ClientInput))
{
   /* take specific steps */
}

« Previous Next »