[Contents] [Previous] [Next] [Index]

isNaN

Evaluates an argument to determine if it is not a number.

Core function

Implemented in

Navigator 2.0: Unix only
Navigator 3.0, LiveWire 1.0: all platforms

Syntax

isNaN(testValue)

Parameters

testValue
The value you want to evaluate.

Description

isNaN is a built-in JavaScript function. It is not a method associated with any object, but is part of the language itself.

On platforms that support NaN, the parseFloat and parseInt functions return "NaN" when they evaluate a value that is not a number. isNaN returns true if passed "NaN", and false otherwise.

Examples

The following example evaluates floatValue to determine if it is a number and then calls a procedure accordingly:

floatValue=parseFloat(toFloat)
if (isNaN(floatValue)) {
   notFloat()
} else {
   isFloat()
}

See also

Number.NaN, parseFloat, parseInt


[Contents] [Previous] [Next] [Index]

Last Updated: 10/31/97 16:38:00


Copyright © 1997 Netscape Communications Corporation