Lodash _.isBoolean() Method

Beginner
5 min read
Updated: Nov 2026
5 examples
Lang

Definition

Checks if value is classified as a boolean primitive or Boolean object. Not the same as truthiness. 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 _.isBoolean. Start with this line.

Lodash
_.isBoolean(value)
CallWhat it does
_.isBoolean(value)Primary signature.

Prefer import isBoolean from "lodash/isBoolean" when you want a smaller bundle.

Library declarations
Lodash
_.isBoolean(value)

Parameters

ParameterDescription
valueRequired. The value to check

Return Value

Return ValueDescription
*true if boolean, else false

Lodash Examples

Example 1 — Official: false

The boolean primitive false is classified as a boolean.

Lodash
_.isBoolean(false);
// → true
Try It Yourself

How It Works

  1. Input. Official sample: the primitive false.
  2. Type. typeof false === "boolean".
  3. Result. true — it is a boolean.
  4. Note. The answer is about type, not “is this value false?”.

Example 2 — Official: null

null is falsy, but it is not a boolean.

Lodash
_.isBoolean(null);
// → false
Try It Yourself

How It Works

  1. Falsy trap. null is falsy in conditionals.
  2. Wrong type. It is not true or false.
  3. Result. false.
  4. Related. Use _.isNull or _.isNil for nullish checks.

Example 3 — Primitive true

Both boolean literals pass.

Lodash
_.isBoolean(true);
// → true

_.isBoolean(false);
// → true
Try It Yourself

How It Works

  1. Both literals. true and false are boolean primitives.
  2. Same helper. The check does not care which boolean it is.
  3. Result. Both return true.
  4. Use. Guard flags before branching on their value.

Example 4 — Boxed Boolean Object

Lodash also accepts new Boolean(...); typeof alone does not.

Lodash
var boxed = new Boolean(false);

_.isBoolean(boxed);           // → true
typeof boxed === "boolean";   // → false  (typeof is "object")
Boolean(boxed);               // → true   (object is truthy!)
Try It Yourself

How It Works

  1. Boxed. new Boolean(false) is a Boolean object.
  2. isBoolean. Lodash classifies it as boolean → true.
  3. typeof. Reports "object" → fails a naive check.
  4. Warning. In if (boxed), the object is always truthy — prefer primitives.

Example 5 — Falsy / Truthy Non-Booleans

Common API and JS values that look boolean-ish but are not.

Lodash
_.isBoolean("false");  // → false
_.isBoolean(0);        // → false
_.isBoolean(1);        // → false
_.isBoolean("");       // → false
Try It Yourself

How It Works

  1. String flags. "false" is a string — parse it first.
  2. Numbers. 0 / 1 are numbers, not booleans.
  3. Empty string. Falsy, but not boolean type.
  4. Rule. Type check ≠ coercion / truthiness.

Browser & Runtime Support

_.isBoolean 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.

✓ Stable · Lodash 0.1.0+

_.isBoolean()

Available in [email protected] full builds and the lodash/isBoolean modular import. Works in evergreen browsers and current Node LTS when Lodash is installed.

100% With Lodash 4.x
Google Chrome Supported · Desktop & Mobile
Full support
Mozilla Firefox Supported · Desktop & Mobile
Full support
Apple Safari Supported · macOS & iOS
Full support
Microsoft Edge Supported · Chromium
Full support
Internet Explorer No native support · Use a polyfill
Polyfill
Opera Supported · Modern versions
Full support
Samsung Internet Supported · Android
Full support
Bun Supported · JavaScript runtime
Supported
Deno Supported · JavaScript runtime
Supported
Node.js Supported · Server runtime
Supported
Android WebView Supported · Modern WebView
Full support
_.isBoolean Lodash 0.1.0+

Bottom line: Safe for production once Lodash is on the page or in your bundle. Prefer import isBoolean from "lodash/isBoolean" for smaller builds. For primitives only, typeof value === "boolean" is enough.

Frequently Asked Questions

_.isBoolean(value) returns true if value is classified as a boolean primitive (true/false) or a Boolean object (new Boolean(...)), otherwise false.
No. Many values are truthy or falsy without being booleans — 0, "", null. _.isBoolean only tests boolean type classification.
For primitives, yes. For boxed Booleans (new Boolean(...)), typeof returns "object" while _.isBoolean still returns true.
Rarely. Boxed booleans are surprising in conditionals (an object is always truthy). Prefer plain true/false literals.
Strings are never booleans. Parse or coerce API flags explicitly before treating them as booleans.
Use import isBoolean from "lodash/isBoolean" or require("lodash/isBoolean") for tree-shaking friendly bundles. Full build: import _ from "lodash" then _.isBoolean.

Next: _.isBuffer()

Check whether a value is a Node.js Buffer instance.

_.isBuffer() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

10 people found this page helpful