On this page
  1. Global.isNaN
  2. Signature & Overview
  3. Notes & Pitfalls
  4. Example

Global.isNaN

Prev: globalThis | Up: Global | Next: tutorials
Rel: Number.isNaN(), Global, JS Core Syntax & Types
Ref: MDN Web Docs — Global.isNaN
Tags: #public #web #javascript #builtins #global #tier/legacy


Signature & Overview

isNaN(value)

Legacy global function that coerces non-numbers first (isNaN('hello') === true).

Legacy / Avoid: Prefer Number.isNaN() in all new code.

Notes & Pitfalls

Example

console.assert(isNaN("abc") === true);         // coerces "abc" -> NaN
console.assert(Number.isNaN("abc") === false); // strict check (preferred)

Linked from

Related notes