* This method is like `_.find` except that it iterates over elements * of a `collection` from right to left. * * @static * @memberOf _ * @category Collections * @param {Array|Object|string} collection The collection to iterate over. * @param {Function|Object|string
(collection, callback, thisArg)
| 38384 | * // => 3 |
| 38385 | */ |
| 38386 | function findLast(collection, callback, thisArg) { |
| 38387 | var result; |
| 38388 | callback = lodash.createCallback(callback, thisArg, 3); |
| 38389 | forEachRight(collection, function(value, index, collection) { |
| 38390 | if (callback(value, index, collection)) { |
| 38391 | result = value; |
| 38392 | return false; |
| 38393 | } |
| 38394 | }); |
| 38395 | return result; |
| 38396 | } |
| 38397 | |
| 38398 | /** |
| 38399 | * Iterates over elements of a collection, executing the callback for each |
nothing calls this directly
no test coverage detected