-
Notifications
You must be signed in to change notification settings - Fork 5
lastIndexOf
Subhajit Sahu edited this page May 19, 2020
·
15 revisions
Finds last index of a value. 🏃 📼 📦 🌔 📒
Alternatives: indexOf, lastIndexOf.
Similar: search, indexOf, isValue, includes.
array.lastIndexOf(x, v, [i]);
// x: an array
// v: search value
// i: start index
const array = require('extra-array');
var x = [1, 2, 3, 2, 5];
array.lastIndexOf(x, 2);
// 3 ^
var x = [1, 2, 3, 2, 5];
array.lastIndexOf(x, 2, 2);
// 1 ^