[] is truthy.![] is false — do not mix the two checks.
0 is empty. Numbers are always empty by Underscore’s definition.
0 is falsy. Truthiness and emptiness are different questions.
Compatibility
Browser & Runtime Support
_.isEmpty 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
_.isEmpty()
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
_.isEmptyUnderscore 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
_.isEmpty(collection) returns true when the value has no elements. Arrays, strings, and arguments objects are empty when length is 0. Other objects are empty when they have no enumerable own properties. null and undefined are empty.
Falsy values are false, 0, '', null, undefined, and NaN. An empty array [] is truthy in JavaScript but _.isEmpty([]) is true. Use !value for truthiness and _.isEmpty for structural emptiness.
_.size returns a count. _.isEmpty returns a boolean. For arrays, strings, and plain objects, _.isEmpty(x) is the same idea as _.size(x) === 0.
Yes. Underscore documents that primitive numbers, booleans, and symbols are always empty by this definition. So _.isEmpty(0), _.isEmpty(false), and _.isEmpty(true) are all true.
Not the way you might expect. Underscore looks at enumerable own keys, and Map/Set instances have none — so a Map with items can still look empty. Check map.size === 0 yourself.
No. It is a stable Underscore 1.x helper for asking whether a collection has no elements.