import { findLastIndex } from "https://dotland.deno.dev/x/lodash_es@v0.0.2/src/array.js";
This method is like _.findIndex
except that it iterates over elements
of collection
from right to left.
Examples
var users = [
{ 'user': 'barney', 'active': true },
{ 'user': 'fred', 'active': false },
{ 'user': 'pebbles', 'active': false }
];
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