Lodash _.findLast() Method
The _.findLast() method iterates over the elements in a collection from the right to the left. It is almost the same as _.find() method.
_.findLast( collection, predicate, fromIndex )
Parameters: This method accepts three parameters as mentioned above and described below:
- collection: It is the collection that the method iterates over.
- predicate: It is the function that is invoked for every iteration.
- fromIndex: It is the index of the array from where the search starts.
Return Value: This method returns the element that matches, else undefined.