Like _.findIndex, but iterates from right to left. Returns the index of the last element predicate finds truthy for, else -1. Stable since Lodash 2.0.0 (4.x Array API).
Note: Native Array.prototype.findLastIndex (ES2023) is a callback-only twin — Lodash still wins when you need iteratee shorthands or older runtimes.
Syntax
Call _.findLastIndex on an array. Start with this line.
Lodash
_.findLastIndex(array, [predicate], [fromIndex])
Call
What it does
_.findLastIndex(array, [predicate], [fromIndex])
Primary signature.
_.findLastIndex(array)
Call with an array argument.
Prefer import findLastIndex from "lodash/findLastIndex" when you want a smaller bundle.
Library declarations
Lodash
_.findLastIndex(array, [predicate], [fromIndex])
Parameters
Parameter
Description
array
Required. Collection to inspect
predicate
Optional. Test per element; default _.identity
fromIndex
Optional. Reverse-scan start; default last index
Return Value
Return Value
Description
*
Number index, or -1
Lodash Examples
Example 1 — Official: Callback
Find the last index where the user name is "pebbles".
Start at 2. Reverse scan begins at value 3, not the last 2.
Walk left. Index 2 fails; index 1 matches.
Rule. A smaller fromIndex can hide later matches on purpose.
Compatibility
Browser & Runtime Support
_.findLastIndex is a Lodash 4.x Array helper (since 2.0.0). It runs anywhere Lodash runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install lodash.
✓ Stable · Lodash 4.x
_.findLastIndex()
Available in [email protected] full builds and the lodash/findLastIndex modular import. Native Array.prototype.findLastIndex needs ES2023 (Chrome 97+, Firefox 104+, Safari 15.4+, Node 18+).
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
_.findLastIndexLodash 4.x+
Bottom line: Safe for production once Lodash is loaded. Prefer import findLastIndex from "lodash/findLastIndex" for smaller bundles. On modern-only targets with callbacks only, native findLastIndex is fine.
Frequently Asked Questions
_.findLastIndex(array, predicate, fromIndex) returns the index of the last element for which predicate is truthy. It scans from right to left. If nothing matches, it returns -1.
No. It only reads the collection and returns a number (the index) or -1.
findIndex scans from the start and returns the first match. findLastIndex scans from the end (or from fromIndex) toward index 0 and returns the last match in that reverse walk.
fromIndex is where the reverse scan begins (default: array.length - 1). Matches to the right of that start are not considered.
Use import findLastIndex from "lodash/findLastIndex" or require("lodash/findLastIndex") for tree-shaking friendly bundles. Full build: import _ from "lodash" then _.findLastIndex.
Array.prototype.findLastIndex (ES2023) is callback-only. Lodash also accepts matches, matchesProperty, and property iteratee shorthands — useful on older runtimes or when you already use Lodash.