-
Notifications
You must be signed in to change notification settings - Fork 1
drop
Subhajit Sahu edited this page Jun 15, 2020
·
17 revisions
Drops values from iterable. 🏃 📼 📦 🌔 📒
Alternatives: drop, dropRight, dropWhile, dropWhileRight.
Similar: take, drop.
iterable.drop(x, [n]);
// x: an iterable
// n: number of values (1)
const iterable = require('extra-iterable');
var x = [1, 2, 3, 4, 5];
[...iterable.drop(x, 2)];
// [ 3, 4, 5 ]
[...iterable.drop(x, 3)];
// [ 4, 5 ]