findLastIndex()
findLastIndex<
T
>(predicate
): (arr
) =>number
Returns the last index of the given array that satisfies the predicate. Returns -1
otherwise.
Type Parameters
• T
Parameters
predicate
Predicate
<T
>
A predicate function to apply to each element of the array.
Returns
Function
Parameters
arr
T
[]
Returns
number
Remark
pure function
Example
findLastIndex(x => !(x & 1))([1, 2, 3, 4, 5]);
// 3