Primitive.typeof true is "boolean" — agrees with Underscore.
Boxed.new Boolean(true) is an object to typeof.
Tag check. Underscore sees [object Boolean] → still true.
Prefer primitives. In new code, use true/false, not new Boolean().
Compatibility
Browser & Runtime Support
_.isBoolean 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
_.isBoolean()
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
_.isBooleanUnderscore 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
_.isBoolean(object) returns true only when the value is true or false — the two boolean primitives — or a boxed new Boolean() object. null, 0, 1, "true", "false", and undefined return false.
_.isBoolean(null) returns false. The docs pick a famous falsy value on purpose: null is not a boolean, even though if (null) is skipped.
Yes. _.isBoolean(true) and _.isBoolean(false) are both true. Underscore’s tests say “but true is, and so is false.”
Truthy values such as 1, "yes", and {} pass if (value). They fail isBoolean. Falsy values such as 0, "", null, and undefined also fail isBoolean. Only the two boolean values pass.
typeof true === "boolean" agrees for primitives. typeof new Boolean(true) is "object", so typeof misses boxed booleans. Underscore also checks the [object Boolean] tag, so boxed values pass.
No. It is a stable Underscore 1.x helper used to decide whether a flag is a real boolean before you branch on it.