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