-
Notifications
You must be signed in to change notification settings - Fork 1
length
Subhajit Sahu edited this page Feb 3, 2021
·
24 revisions
Counts the number of values. 🏃 📼 📦 🌔 📒
Similar: index, indexRange, size, isEmpty.
iterable.length(x, [i], [I]);
// x: an iterable
// i: start index (0)
// I: end index (X)
const iterable = require("extra-iterable");
var x = [2, 4, 6, 8];
iterable.length(x);
// 4
iterable.length(x, 1);
// 3
iterable.length(x, 1, 3);
// 2