Checks if value is NaN. Based on Number.isNaN — not the same as global isNaN, which coerces non-numbers. Part of Lodash Lang since 0.1.0 (stable — not deprecated).
Pass the value you want to inspect or convert. Read the return type carefully before you use the result.
Syntax
Call _.isNaN. Start with this line.
Lodash
_.isNaN(value)
Call
What it does
_.isNaN(value)
Primary signature.
Prefer import isNan from "lodash/isNan" when you want a smaller bundle.
Finite numbers. Regular integers fail the NaN check.
Infinity. Not NaN — use _.isFinite for finiteness.
Compatibility
Browser & Runtime Support
_.isNaN is a Lodash Lang helper (available since 0.1.0, stable in 4.x). It runs anywhere Lodash runs — modern browsers (via CDN or bundle) and Node.js / Bun / Deno with npm install lodash. Behavior is aligned with Number.isNaN (plus boxed Number support).
✓ Stable · Lodash 0.1.0+
_.isNaN()
Available in [email protected] full builds and the lodash/isNaN modular import. Works in evergreen browsers and current Node LTS when Lodash is installed.
100%With Lodash 4.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
_.isNaNLodash 0.1.0+
Bottom line: Safe for production once Lodash is on the page or in your bundle. Prefer import isNaN from "lodash/isNaN" for smaller builds. Native alternative for primitives: Number.isNaN(value).
Frequently Asked Questions
_.isNaN(value) returns true if value is NaN — including the NaN primitive and boxed new Number(NaN). Non-numbers like undefined and strings return false.
No. Global isNaN coerces values first, so isNaN(undefined) and isNaN("abc") are true. Lodash does not coerce — it is based on Number.isNaN-style intent.
Almost. Lodash also returns true for boxed Number(NaN), while Number.isNaN(new Number(NaN)) is false.
NaN is never equal to itself with ===. Use _.isNaN, Number.isNaN, or the idiom value !== value.
No. The string "NaN" is not a number. Global isNaN("NaN") is true only because of coercion.
Use import isNaN from "lodash/isNaN" or require("lodash/isNaN"). Full build: import _ from "lodash" then _.isNaN.