Use case. APIs often use null to mean “cleared on purpose.”
Compatibility
Browser & Runtime Support
_.isNull 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+
_.isNull()
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
_.isNullUnderscore 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
_.isNull(object) returns true only when the value is null. undefined, 0, empty strings, false, and objects all return false.
_.isNull(null) returns true. _.isNull(undefined) returns false. That pair shows the helper only accepts the null primitive, not other falsy or missing values.
value == null is true for both null and undefined because == coerces. _.isNull(null) is true but _.isNull(undefined) is false. Use isNull when you need strict null only.
That is a long-standing JavaScript quirk. typeof null is "object", so typeof alone cannot detect null. _.isNull uses obj === null instead.
No. undefined is a separate primitive. Only null passes _.isNull. To catch both, use value == null or check each case separately.
No. It is a stable Underscore helper (since 0.4.7). Use it for a readable strict null check.