Lodash _.reject() Method

Beginner
5 min read
Updated: Nov 2026
5 examples
Collection

Definition

The opposite of _.filter: returns the elements of a collection that the predicate does not return truthy for. 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 _.reject on a collection. Start with this line.

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

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

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

Parameters

ParameterDescription
collectionRequired. Array or object to scan
predicateOptional. Function or shorthand; default identity

Return Value

Return ValueDescription
*New array of elements where predicate is falsy

Lodash Examples

Example 1 — Official: Function Predicate

Reject inactive users — keep those where !o.active is falsy (i.e. active).

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

_.reject(users, function (o) {
  return !o.active;
});
// → [{ user: "fred", age: 40, active: true }]
Try It Yourself

How It Works

  1. Predicate. !o.active is truthy for inactive users.
  2. Reject. Truthy hits are dropped — barney is removed.
  3. Keep. fred has active: true, so !o.active is falsy → kept.
  4. Readability. This official form is the complement of filtering inactive users.

Example 2 — Official: Property Shorthand

A string iteratee rejects elements where that property is truthy.

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

_.reject(users, "active");
// → [{ user: "barney", active: false }]
Try It Yourself

How It Works

  1. Shorthand. "active" means read each object’s .active.
  2. fred. true → rejected.
  3. barney. false → kept.
  4. Same as. function (o) { return o.active; } with reject.

Example 3 — Official: Matcher Object

Reject objects that match a partial shape.

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

_.reject(users, { age: 40, active: true });
// → [{ user: "barney", age: 36, active: false }]
Try It Yourself

How It Works

  1. Matcher. Lodash treats the object as a partial match (_.matches).
  2. fred matches. Both age: 40 and active: true → rejected.
  3. barney does not. Stays in the result.
  4. Use. Handy when several fields define “drop this row.”

Example 4 — Official: matchesProperty Pair

Pass [path, value] to reject rows where that property equals the value.

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

_.reject(users, ["active", false]);
// → [{ user: "fred", active: true }]
Try It Yourself

How It Works

  1. Pair. ["active", false] means “is active equal to false?”.
  2. barney. Matches → rejected.
  3. fred. Does not match → kept.
  4. Flip. Compared with example 2, you target inactive rows for removal.

Example 5 — Reject Odd Numbers

A simple numeric predicate — keep only even values.

Lodash
_.reject([1, 2, 3, 4], function (n) {
  return n % 2 === 1;
});
// → [2, 4]
Try It Yourself

How It Works

  1. Test. n % 2 === 1 is truthy for odds.
  2. Drop odds. 1 and 3 are rejected.
  3. Keep evens. 2 and 4 stay, in order.
  4. Same idea. _.filter(arr, n => n % 2 === 0) — pick the wording that reads best.

Browser & Runtime Support

_.reject is a Lodash 4.x Collection helper (since 0.1.0). 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+

_.reject()

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

Bottom line: Safe for production once Lodash is on the page or in your bundle. Prefer import reject from "lodash/reject" for smaller builds. Not a native browser API — load Lodash first. Native arrays can use filter with a negated predicate instead.

Frequently Asked Questions

_.reject(collection, predicate) returns a new array of elements for which the predicate is falsy — the opposite of _.filter with the same predicate.
No. It builds a new array. Object elements are still shared by reference — rejecting does not deep-clone.
filter keeps truthy predicate hits; reject keeps falsy ones. Same iteratee shorthands work for both.
Use reject when you only need the non-matches. Use _.partition when you need both buckets in one pass.
An array of values (not an object). Keys are not preserved — same as _.filter on objects.
Use import reject from "lodash/reject" or require("lodash/reject") for tree-shaking. Full build: import _ from "lodash" then _.reject.

Next: _.sample()

Pick a single random element from a collection.

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