-
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. [:running:] [:vhs:] [:package:] [:moon:] [:ledger:]
Alternatives: [indexOf], [lastIndexOf].
iterable.lastIndexOf(x, v, [i]);
// x: an iterable
// 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 ^