Standard built-ins

Global isNaN()

Try the free JavaScript compiler

Converts value to Number and checks the resulting NaN. Invalid text may return true even though it is not already NaN. Some inputs, such as Symbol or BigInt, cause TypeError during conversion. Prefer Number.isNaN for noncoercive validation.

Formal Syntax & Structure

javascript syntaxjavascript
isNaN(value)

Parameters & Attributes

NameTypeDescription
valueanyInput converted to Number.

Return Value

boolean

Whether numeric coercion produced NaN.

Working Example

Example Snippetjavascript
console.log(isNaN("bad"),isNaN("12"));
JavaScript Reference