Skip to content

rejectAt

Subhajit Sahu edited this page Feb 3, 2021 · 10 revisions

Discard the values at given indices.

Alternatives: reject, rejectAt.
Similar: map, filter, reject, reduce, accumulate.


function rejectAt(x, is)
// x:  an iterable
// is: indices (sorted)
const xiterable = require('extra-iterable');

var x = [2, 4, 6, 8];
[...xiterable.rejectAt(x, [1, 2])];
// → [2, 8]

[...xiterable.rejectAt(x, [1, 3])];
// → [2, 6]


References

Clone this wiki locally