_.isNaN ships with Underscore.js (since 0.4.7). It runs anywhere Underscore runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install underscore.
✓ Stable · Underscore 0.4.7+
_.isNaN()
Available since [email protected] (UMD / ESM). Works in evergreen browsers and current Node LTS when Underscore is loaded.
100%With Underscore 1.x
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
BunSupported · JavaScript runtime
Supported
DenoSupported · JavaScript runtime
Supported
Node.jsSupported · Server runtime
Supported
Android WebViewSupported · Modern WebView
Full support
_.isNaNUnderscore 0.4.7+
Bottom line: Safe for production once Underscore is on the page or in your bundle. Not a native browser API — load Underscore first. Prefer a pinned CDN version (e.g. [email protected]).
Frequently Asked Questions
_.isNaN(object) returns true only when the value is the Number NaN — for example NaN or 0/0. undefined, null, strings, Infinity, and ordinary numbers return false.
_.isNaN(NaN) returns true. _.isNaN(undefined) returns false. Native isNaN(undefined) returns true. That pair shows Underscore only accepts real NaN values.
Native isNaN coerces its argument. isNaN(undefined) is true because undefined becomes NaN. Underscore requires a Number that is NaN, so undefined, null, and strings fail.
isNumber is a type check and includes NaN, Infinity, and finite numbers. isNaN is the narrow case: only NaN passes. Infinity and 42 pass isNumber and fail isNaN.
Number.isNaN (ES2015) is also strict and does not coerce. _.isNaN and Number.isNaN usually agree on NaN vs undefined. Prefer Number.isNaN when you do not need Underscore.
No. It is a stable Underscore helper (since 0.4.7). Use it when you need to detect the actual Number NaN without native coercion surprises.