Favorites

JavaScript Array.prototype.findLast() Method

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee
Array.prototype.findLast()
JavaScript Array Instance methodThis method is supported by all modern browsers.
Updated 28th November 2026

The findLast() method searches an array from the end and returns the last element that passes a test.

Description

The findLast() method works like find(), but searches backwards from the last element and returns the first match it finds, which is the last matching element in the array. It returns undefined if nothing matches.

It's handy for things like the most recent log entry of a certain type, without having to reverse a copy of the array first.

It was added in 2023 together with findLastIndex() and is supported in all current browsers. Before that, the usual approach was [...arr].reverse().find(...), which creates a copy of the array; findLast() avoids the copy and makes the intent clearer. As with find(), it stops as soon as it finds a match.

Syntax

array.findLast(callbackFn)
array.findLast(callbackFn, thisArg)

Parameters

  • callbackFnA function called for each element, receiving element, index and array.
  • thisArgOptional. A value to use as this inside callbackFn.

Return Value

The last element that passes the test, or undefined if none does.

Example

const events = [
  { type: 'login', time: 1 },
  { type: 'click', time: 2 },
  { type: 'login', time: 3 },
];
console.log(events.findLast(e => e.type === 'login'));

Browser Support

The following information will show you the current browser support for the Array.prototype.findLast() method. Hover over a browser icon to see the version that first introduced support for this method.

This method is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee