NaN. Number type → isNumber true; use isNaN to name it.
isFinite. Rejects NaN and Infinity.
Infinity. Still a Number type.
Pick the tool. Type vs usable finite value.
Compatibility
Browser & Runtime Support
_.isNumber ships with Underscore.js (1.x). It runs anywhere Underscore runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install underscore.
✓ Stable · Underscore 1.x
_.isNumber()
Available in [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
_.isNumberUnderscore 1.x+
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
_.isNumber(object) returns true when the value is a Number — integers, floats, 0, Infinity, NaN, and boxed new Number() objects. Strings such as "8", arrays, objects, and null return false.
_.isNumber(8.4 * 5) returns true. That product is 42, a real Number, so Underscore treats it as a Number.
Yes. The Underscore docs say including NaN. In JavaScript, NaN is a Number (typeof NaN === "number"). Use _.isNaN when you specifically need to detect NaN, or _.isFinite when you need a usable finite number.
typeof 8 === "number" agrees for primitives, including NaN and Infinity. typeof new Number(8) is "object", so typeof misses boxed numbers. Underscore uses a [object Number] tag test, so both forms pass isNumber.
isNumber is the type check: NaN and Infinity pass. isFinite asks whether the value is a finite Number, so NaN and Infinity fail. Use isFinite before arithmetic that must stay in range.
No. It is a stable Underscore 1.x helper used to decide whether a value is a Number before you do math or compare numeric options.