Looks through each value in the list, returning the first one that passes a truth test (predicate), or undefined if no value passes. Returns as soon as it finds an acceptable element (official Underscore docs). Stable Collection helper — not deprecated.
Pass the required arguments shown below. Underscore collection helpers usually return a new value — check whether the source is mutated.
Syntax
Call _.find. Start with this line.
Underscore
_.find(list, predicate, [context])
Call
What it does
_.find(list, predicate, [context])
Primary signature.
_.find(...)
Call with the arguments your case needs.
Load Underscore with import _ from "underscore" (or the UMD CDN build) so these helpers are available as _.
Library declarations
Underscore
_.find(list, predicate, [context])
Parameters
Parameter
Description
list
Required. Array, array-like, or plain object
predicate
Required. Truth test; shorthands via iteratee
context
Optional. Bound as this in the predicate
Return Value
Return Value
Description
*
First match, or undefined
Underscore.js Examples
Example 1 — Official Docs First Even
Return the first even number from 1 through 6.
Underscore
var even = _.find([1, 2, 3, 4, 5, 6], function (num) {
return num % 2 == 0;
});
even;
// → 2
Guard. Check the result before reading properties.
Compatibility
Browser & Runtime Support
_.find (alias _.detect) 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
_.find()
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
_.findUnderscore 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
_.find(list, predicate, [context]) returns the first value that passes the predicate, or undefined if none do. Official example: first even in [1..6] → 2.
Yes. detect is an alias of find. They are the same function.
_.find returns undefined. Always guard the result before using it.
_.find returns one value and stops early. _.filter returns a new array of every match and scans the whole list.
Yes. It returns as soon as it finds an acceptable element and does not traverse the rest of the list.
Yes. Pass an object matcher or a property name string. Underscore runs the predicate through iteratee.