The array to inspect.
Optional
predicate: anyThe function invoked per iteration.
Optional
fromIndex: numberThe index to search from.
Returns the index of the found element, else -1
.
var users = [
{ 'user': 'barney', 'active': true },
{ 'user': 'fred', 'active': false },
{ 'user': 'pebbles', 'active': false }
];
findLastIndex(users, function(o) { return o.user == 'pebbles'; });
// => 2
// The `matches` iteratee shorthand.
findLastIndex(users, { 'user': 'barney', 'active': true });
// => 0
// The `matchesProperty` iteratee shorthand.
findLastIndex(users, ['active', false]);
// => 2
// The `property` iteratee shorthand.
findLastIndex(users, 'active');
// => 0
This method is like
findIndex
except that it iterates over elements ofcollection
from right to left.