Lodash _.every() Method

Beginner
5 min read
Updated: Nov 2026
5 examples
Collection

Definition

Checks whether a predicate returns truthy for all elements of a collection. Stops at the first falsey result. Empty collections return true (vacuous truth). Part of Lodash 4.x Collection (since 0.1.0).

Pass the required arguments shown below. Lodash Collection helpers usually return a new value — check whether the source is mutated.

Syntax

Call _.every on a collection. Start with this line.

Lodash
_.every(collection, [predicate=_.identity])
CallWhat it does
_.every(collection, [predicate=_.identity])Primary signature.
_.every(collection)Call with a collection argument.

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

Library declarations
Lodash
_.every(collection, [predicate=_.identity])

Parameters

ParameterDescription
collectionRequired. Array or object to test
predicateOptional. Per-element test; default _.identity

Return Value

Return ValueDescription
*true or false

Lodash Examples

Example 1 — Official: Coerce with Boolean

null is falsey, so the whole check fails.

Lodash
_.every([true, 1, null, "yes"], Boolean);
// → false
Try It Yourself

How It Works

  1. Coerce. Boolean turns each value into true/false.
  2. Pass. true and 1 are truthy.
  3. Fail. null is falsey → return false.
  4. Short-circuit. "yes" is never checked.

Example 2 — Official: matchesProperty Shorthand

Check that every user has active: false.

Lodash
var users = [
  { user: "barney", age: 36, active: false },
  { user: "fred",   age: 40, active: false }
];

_.every(users, ["active", false]);
// → true
Try It Yourself

How It Works

  1. Shorthand. ["active", false] means “property equals value”.
  2. Barney. active is false → pass.
  3. Fred. Same → pass.
  4. All pass. Result is true.

Example 3 — Official: Property Shorthand

Treat each object’s active field as the predicate.

Lodash
var users = [
  { user: "barney", age: 36, active: false },
  { user: "fred",   age: 40, active: false }
];

_.every(users, "active");
// → false
Try It Yourself

How It Works

  1. Shorthand. "active" reads that property on each item.
  2. Falsey field. Barney’s active is false.
  3. Fail fast. First falsey value ends the check.
  4. Result. false — not everyone is active.

Example 4 — Custom Function Predicate

Require every number to be positive.

Lodash
_.every([2, 4, 6], function (n) {
  return n > 0;
});
// → true

_.every([2, -1, 6], function (n) {
  return n > 0;
});
// → false
Try It Yourself

How It Works

  1. Guard. Function returns whether n > 0.
  2. First call. All positives → true.
  3. Second call. -1 fails → false.
  4. Use case. Form validation, range checks, “all ready” flags.

Example 5 — Empty Collection Returns true

No elements means no failures — same as native Array.every.

Lodash
_.every([], Boolean);
// → true

_.every({}, "active");
// → true
Try It Yourself

How It Works

  1. Vacuous truth. Nothing failed the predicate.
  2. Empty array. Predicate is never called → true.
  3. Empty object. Same rule for plain objects.
  4. Guard. Pair with a length/size check if empty should mean “invalid”.

Browser & Runtime Support

_.every is a Lodash 4.x Collection helper (since 0.1.0). It runs anywhere Lodash runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install lodash. Native Array.prototype.every covers arrays only; Lodash also walks plain objects and offers iteratee shorthands.

✓ Stable · Lodash 4.x

_.every()

Available in [email protected] full builds and the lodash/every 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
_.every Lodash 4.x+

Bottom line: Safe for production once Lodash is loaded. Prefer import every from "lodash/every" for smaller builds. Ideal for form guards, “all ready” checks, and permission validation.

Frequently Asked Questions

_.every(collection, predicate) returns true if predicate is truthy for every element. It stops early on the first falsey result.
No. It only reads values while testing. The source array or object is unchanged.
_.every returns true for empty collections (vacuous truth) — same idea as Array.prototype.every.
every requires all matches. some returns true on the first match. Use some for “at least one”.
Three: (value, index|key, collection). Shorthands like property names, match objects, and [path, value] pairs also work.
Use import every from "lodash/every" or require("lodash/every") for tree-shaking. Full build: import _ from "lodash" then _.every.

Next: _.filter()

Collect every element that passes a predicate into a new array.

_.filter() 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