-
Notifications
You must be signed in to change notification settings - Fork 1
index
Subhajit Sahu edited this page May 17, 2020
·
21 revisions
Gets zero-based index. 🏃 📼 📦 🌔 📒
Similar: index, indexRange, [size], [isEmpty].
iterable.index(x, [i]);
// x: an iterable
// i: index (-ve: from right) (0)
const iterable = require('extra-iterable');
var x = [2, 4, 6, 8];
iterable.index(x, 1);
// 1
iterable.index(x, -1);
// 3
iterable.index(x, -10);
// 0