Lodash _.find() Method

Beginner
5 min read
Updated: Nov 2026
5 examples
Collection

Definition

Returns the first element for which a predicate is truthy. Stops as soon as a match is found. Returns undefined when nothing matches. 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 _.find on a collection. Start with this line.

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

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

Library declarations
Lodash
_.find(collection, [predicate=_.identity], [fromIndex=0])

Parameters

ParameterDescription
collectionRequired. Array or object to search
predicateOptional. Match test; default _.identity
fromIndexOptional. Array start index; default 0

Return Value

Return ValueDescription
*Matched element or undefined

Lodash Examples

Example 1 — Official: Custom Function

Return the first user with age < 40.

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

_.find(users, function (o) {
  return o.age < 40;
});
// → { user: "barney", age: 36, active: true }
Try It Yourself

How It Works

  1. Predicate. Function checks o.age < 40.
  2. Barney. Age 36 passes → return that object.
  3. Stop. Fred and pebbles are skipped.
  4. Reference. You get the same object from the array, not a clone.

Example 2 — Official: matches Object

Find the first object that deeply matches the partial shape.

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

_.find(users, { age: 1, active: true });
// → { user: "pebbles", age: 1, active: true }
Try It Yourself

How It Works

  1. Shorthand. Object means “must match these fields”.
  2. Skip. Barney and fred do not match both fields.
  3. Hit. Pebbles matches age: 1 and active: true.
  4. Return. That whole user object.

Example 3 — Official: matchesProperty Shorthand

Find the first user with active === false.

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

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

How It Works

  1. Shorthand. ["active", false] means property equals value.
  2. Barney. active is true → skip.
  3. Fred. active is false → return.
  4. Stop. Pebbles is never checked.

Example 4 — Official: Property Shorthand

Treat each object’s active field as the predicate.

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

_.find(users, "active");
// → { user: "barney", age: 36, active: true }
Try It Yourself

How It Works

  1. Shorthand. "active" reads that property on each item.
  2. Truthiness. Barney’s active is true.
  3. Return. First truthy field wins — barney.
  4. Note. Later active users (pebbles) are not returned.

Example 5 — Start Later with fromIndex

Skip earlier items; search begins at the given array index.

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

_.find(users, function (o) {
  return o.age < 40;
}, 1);
// → { user: "pebbles", age: 1, active: true }

_.find(users, { user: "wilma" });
// → undefined
Try It Yourself

How It Works

  1. fromIndex 1. Barney (index 0) is skipped.
  2. Fred. Age 40 fails < 40.
  3. Pebbles. Age 1 passes → returned.
  4. No match. Missing users return undefined, not null.

Browser & Runtime Support

_.find 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.find covers arrays only; Lodash also walks plain objects and offers iteratee shorthands plus fromIndex.

✓ Stable · Lodash 4.x

_.find()

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

Bottom line: Safe for production once Lodash is loaded. Prefer import find from "lodash/find" for smaller builds. Ideal for lookup-by-field, first active row, and config matching.

Frequently Asked Questions

_.find(collection, predicate, [fromIndex=0]) returns the first element whose predicate is truthy. If nothing matches, it returns undefined.
No. It only reads until a match is found. The source array or object is unchanged.
find returns one element (or undefined). filter returns an array of every match and always walks the whole collection.
find scans left-to-right (or object order). findLast scans right-to-left and returns the last match.
For array-like collections, fromIndex is where the search starts (default 0). Negative values count from the end.
Use import find from "lodash/find" or require("lodash/find") for tree-shaking. Full build: import _ from "lodash" then _.find.

Next: _.findLast()

Scan from the right and return the last element that passes a predicate.

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