Like _.findIndex, but iterates the array in reverse and returns the index closest to the end where the predicate truth test passes (official Underscore docs).
Pass the required arguments shown below. Underscore array helpers usually return a new value — check whether the source array is mutated.
Syntax
Call _.findLastIndex. Start with this line.
Underscore
_.findLastIndex(array, predicate, [context])
Call
What it does
_.findLastIndex(array, predicate, [context])
Primary signature.
_.findLastIndex(...)
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
_.findLastIndex(array, predicate, [context])
Parameters
Parameter
Description
array
Required. List to search (backward)
predicate
Required. Function or iteratee (matcher / property)
context
Optional. this for a function predicate
Return Value
Return Value
Description
*
Index number, or -1
Underscore.js Examples
Example 1 — Official Matcher Object
Pass a property matcher — Underscore finds the last object that matches.
Pick by intent. Need the earliest hit → findIndex; the latest → findLastIndex.
Compatibility
Browser & Runtime Support
_.findLastIndex 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. Native Array.prototype.findLastIndex is separate (ES2023) and is not required.
✓ Stable · Underscore 1.x
_.findLastIndex()
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
_.findLastIndexUnderscore 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
_.findLastIndex(array, predicate, [context]) returns the index of the last element that passes a truth test, searching from the end. If nothing matches, it returns -1.
_.findIndex scans from the start and returns the first passing index. _.findLastIndex scans from the end and returns the last passing index. Both share the same predicate / iteratee rules.
Yes. Underscore runs the predicate through _.iteratee, so a matcher like { name: 'Ted' } works — that is the official docs example.
_.lastIndexOf looks for a value with strict === equality. _.findLastIndex runs a predicate (or matcher) so you can match by property, range, or any custom rule.
It returns -1. Check with if (index !== -1) before using the index to update or splice.
No. It only reads the array and returns a number. The source stays unchanged.