Skip to content
Subhajit Sahu edited this page Dec 28, 2022 · 17 revisions

Remove first n entries (default order).

Similar: take, drop.


function drop(x, n)
// x: a map
// n: number of entries [1]
const xilists = require('extra-ilists');

var x = [['a', 'b', 'c', 'd', 'e'], [1, 2, 3, 4, 5]];
xilists.drop(x, 2).map(c => [...c]);
// → [ [ 'c', 'd', 'e' ], [ 3, 4, 5 ] ]

xilists.drop(x, 3).map(c => [...c]);
// → [ [ 'd', 'e' ], [ 4, 5 ] ]


References

Clone this wiki locally