Standard built-ins
Global isNaN()
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
| Name | Type | Description |
|---|---|---|
| value | any | Input converted to Number. |
Return Value
boolean
Whether numeric coercion produced NaN.
Working Example
Example Snippetjavascript
console.log(isNaN("bad"),isNaN("12"));