UNPKG

es-toolkit

Version:

A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.

12 lines (11 loc) 288 B
//#region src/fp/array/findLast.ts function findLast(predicate) { return function(array) { for (let index = array.length - 1; index >= 0; index--) { const value = array[index]; if (predicate(value, index, array)) return value; } }; } //#endregion exports.findLast = findLast;