JavaScript can surprise even in 2025. It would seem that we already have everything to work with arrays: map, filter, find, reduce... But recently new methods have appeared — findLast() and findLastIndex(). And this is not just cosmetics, but a real little revolution.
Why do we need new methods?
Until recently, if we needed to find last element of the array, satisfying the condition, had to be bypassed:
Flip the array through
reverse()and applyfind().Or go through the cycle from the end.
The disadvantages are obvious:
reverse()mutates the array — dangerous and not obvious.The cycle is cumbersome and not in the spirit of modern JavaScript.

What has changed
Now everything is easier:
findLast()searches for the last element that matches the condition.findLastIndex()returns the index of this element.
const users = [
{ name: "Anya", active: false },
{ name: "Boris", active: true },
{ name: "Vika", active: false },
{ name: "Gosha", active: true }
];
console.log(users.findLast(user => user.active));
// { name: "Gosha", active: true }}
console.log(users.findLastIndex(user => user.active));
// 3
Why is it better than the old tricks?
The code is readable as text - no need to guess the plan.
Safety — no array mutations.
Speed — the interpreter goes from the end and stops at the first match.
"Before/after": examples
Task | Was (before) | Now |
|---|---|---|
Last active user | | |
Last error index | | |
Last even element | | |

Frequently Asked Questions
What is returned?
findLast()— element orundefined.findLastIndex()— index or-1.About performance: passes the array once from the end, without turning and copying.
TypeScript: signatures are similar to
find/findIndex, the transition is minimal.
Conclusion
findLast() and findLastIndex() are a practical replacement for crutch patterns with reverse() and manual loops. The code becomes shorter, safer and more obvious.
🙌 We discuss all these features and novelties in our cozy Telegram channel, where we share news from the world of development, analyze new tools and joke about the life of programmers. Join us — it will be interesting!
