Like _.find, but iterates right to left. Returns the last element that passes your predicate — or undefined if none match. Part of Lodash 4.x Collection.
Pass the required arguments shown below. Lodash Collection helpers usually return a new value — check whether the source is mutated.
Syntax
Call _.findLast on a collection. Start with this line.
Lodash
_.findLast(collection, [predicate], [fromIndex])
Call
What it does
_.findLast(collection, [predicate], [fromIndex])
Primary signature.
_.findLast(collection)
Call with a collection argument.
Prefer import findLast from "lodash/findLast" when you want a smaller bundle.
Library declarations
Lodash
_.findLast(collection, [predicate], [fromIndex])
Parameters
Parameter
Description
collection
Required. Array or object to inspect
predicate
Optional. Test per element; default _.identity
fromIndex
Optional. Start of reverse scan (arrays); default length - 1
Return Value
Return Value
Description
*
Matched element, else undefined
Lodash Examples
Example 1 — Official: Last Odd Number
Scan [1, 2, 3, 4] from the end; keep the last odd value.
Lodash
_.findLast([1, 2, 3, 4], function (n) {
return n % 2 == 1;
});
// → 3
findLast. Starts at 18 — already even → returns 18.
Pick by intent. “Earliest” → _.find; “latest” → _.findLast.
Compatibility
Browser & Runtime Support
_.findLast is a Lodash 4.x Collection helper. It runs anywhere Lodash runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install lodash. Native Array.prototype.findLast is ES2023 and separate.
✓ Stable · Lodash 4.x
_.findLast()
Available in [email protected] full builds and the lodash/findLast 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
_.findLastLodash 4.x+
Bottom line: Safe for production once Lodash is loaded. Prefer import findLast from "lodash/findLast" for smaller builds. For array-only modern JS without Lodash, see native Array.findLast.
Frequently Asked Questions
_.findLast(collection, predicate, fromIndex) returns the last element that satisfies the predicate. On arrays it scans from right to left. If nothing matches, it returns undefined.
No. It only reads elements until a match is found. The source array or object is left unchanged.
_.find returns the first match (left-to-right). _.findLast returns the last match (right-to-left). Same iteratee shorthands; only direction changes.
For array-like collections, fromIndex is where the reverse scan starts (default: collection.length - 1). Use it to ignore elements after that index.
_.findLast returns undefined — same sentinel as _.find. Guard the result before reading properties.
Native Array.findLast (ES2023) is fine for modern array-only code. Prefer _.findLast when you need Lodash iteratee shorthands, objects as collections, or older runtimes via Lodash.