UNPKG

js-fns

Version:

Modern JavaScript utility library focused on the build size

12 lines (11 loc) 442 B
/** * Returns the index of the last matching element in an array. * * @param array - The array to find element index in * @param matcher - The function that returns true if element satisfies a condition * @returns A last element index that satisfies the condition * * @category Array * @public */ export default function findLastIndex<ElementType>(array: Array<ElementType>, matcher: (element: ElementType) => boolean): number | -1;