Skip to content
Subhajit Sahu edited this page Dec 22, 2022 · 15 revisions

Discard first n values only.

Similar: take, drop.


function drop(x, n?)
// x: an iterable
// n: number of values [1]
const entries = require('extra-entries');

var x = [["a", 1], ["b", 2], ["c", 3], ["d", 4], ["e", 5]];
[...entries.drop(x, 2)];
// → [ [ "c", 3 ], [ "d", 4 ], [ "e", 5 ] ]

[...entries.drop(x, 3)];
// → [ [ "d", 4 ], [ "e", 5 ] ]


References

Clone this wiki locally