Findlastindex

_.findIndex()

This method is like _.findIndex except that it iterates over elements of collection from right to left.

Arguments

array (Array): The array to inspect.
[predicate=_.identity] (Function): The function invoked per iteration.
[fromIndex=array.length-1] (number): The index to search from.

Returns

(number): Returns the index of the found element, else -1.

Example