This method is like findIndex except that it iterates over elements of collection from right to left.
findIndex
collection
The array to inspect.
The function invoked per iteration.
Optional
The index to search from.
Returns the index of the found element, else -1.
-1
2.0.0
find, findIndex, findKey, findLast, findLastKey
const users = [ { 'user': 'barney', 'active': true }, { 'user': 'fred', 'active': false }, { 'user': 'pebbles', 'active': false }]findLastIndex(users, ({ user }) => user == 'pebbles')// => 2 Copy
const users = [ { 'user': 'barney', 'active': true }, { 'user': 'fred', 'active': false }, { 'user': 'pebbles', 'active': false }]findLastIndex(users, ({ user }) => user == 'pebbles')// => 2
This method is like
findIndex
except that it iterates over elements ofcollection
from right to left.