Like _.find, but returns the index of the first element for which predicate is truthy — not the element itself. Returns -1 when nothing matches. Part of Lodash Array since 1.1.0 (stable in 4.x — not deprecated).
Pass the required arguments shown below. Lodash Array helpers usually return a new value — check whether the source array is mutated.
Syntax
Call _.findIndex on an array. Start with this line.
Scan ends. Every element fails the matches object.
Result. Lodash returns -1 — not an error.
Guard. Check idx !== -1 before users[idx].
Compatibility
Browser & Runtime Support
_.findIndex is a Lodash 4.x Array helper (since 1.1.0). It runs anywhere Lodash runs — modern browsers (via CDN or bundle) and Node.js / Bun / Deno with npm install lodash. Native Array.prototype.findIndex is also available in modern JS engines.
✓ Stable · Lodash 1.1.0+
_.findIndex()
Available in [email protected] full builds and the lodash/findIndex modular import. Works in evergreen browsers and current Node LTS when Lodash is installed.
100%With Lodash 4.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
_.findIndexLodash 1.1.0+
Bottom line: Safe for production once Lodash is on the page or in your bundle. Prefer import findIndex from "lodash/findIndex" for smaller builds — or native array.findIndex() when you do not need Lodash iteratee shorthands.
Frequently Asked Questions
_.findIndex(array, predicate, [fromIndex=0]) returns the index of the first element for which predicate is truthy. If nothing matches, it returns -1. It does not mutate the array.
_.find returns the matching element itself. _.findIndex returns that element’s index (or -1). Same iteratee shorthands work on both.
indexOf compares a single value with SameValueZero equality. findIndex runs a predicate (or Lodash iteratee) per element, so you can match objects by field or custom logic.
Search starts at that index. Negative values count from the end (like other Lodash array helpers). Matches before fromIndex are skipped.
Lodash returns -1 — same convention as native Array.prototype.findIndex.
Use import findIndex from "lodash/findIndex" or require("lodash/findIndex") so bundlers can tree-shake unused Lodash code. Full build: import _ from "lodash" then _.findIndex.