-
Notifications
You must be signed in to change notification settings - Fork 5
filterAt
Subhajit Sahu edited this page Jun 20, 2020
·
13 revisions
Keeps the values at given indices. 🏃 📼 📦 🌔 📒
Alternatives: filter, filterAt.
Similar: map, filter, reject, reduce, accumulate.
iterable.filterAt(x, is);
// x: an iterable
// is: indices
const iterable = require('extra-iterable');
var x = [2, 4, 6, 8];
[...iterable.filterAt(x, [1, 2])];
// [ 4, 6 ]
[...iterable.filterAt(x, [1, 3])];
// [ 4, 8 ]