reports/frontend/node_modules/es-toolkit/dist/fp/array/findLast.js
jtricerolph 1c411e402e Add settings page for managing forecasting API key and URL via UI
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-20 14:37:36 +00:00

11 lines
288 B
JavaScript

//#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;