Skip to content
Subhajit Sahu edited this page May 19, 2020 · 17 revisions

Drops given number of values from iterable. 🏃 📼 📦 🌔 📒

Alternatives: drop, dropWhile.
Similar: take, drop.

iterable.drop(x, [n]);
// x: an iterable
// n: number of values
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 ]

references

Clone this wiki locally