mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 01:17:50 +00:00
Bump to v3.6.0.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
define(['../internal/baseCallback'], function(baseCallback) {
|
||||
define(['../internal/createFindIndex'], function(createFindIndex) {
|
||||
|
||||
/**
|
||||
* This method is like `_.findIndex` except that it iterates over elements
|
||||
@@ -48,16 +48,7 @@ define(['../internal/baseCallback'], function(baseCallback) {
|
||||
* _.findLastIndex(users, 'active');
|
||||
* // => 0
|
||||
*/
|
||||
function findLastIndex(array, predicate, thisArg) {
|
||||
var length = array ? array.length : 0;
|
||||
predicate = baseCallback(predicate, thisArg, 3);
|
||||
while (length--) {
|
||||
if (predicate(array[length], length, array)) {
|
||||
return length;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
var findLastIndex = createFindIndex(true);
|
||||
|
||||
return findLastIndex;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user