-
Notifications
You must be signed in to change notification settings - Fork 1
map
Subhajit Sahu edited this page Feb 3, 2021
·
26 revisions
Transform values of an iterable.
Similar: map, filter, reject, reduce, accumulate.
function map(x, fm)
// x: an iterable
// fm: map function (v, i, x)
const xiterable = require('extra-iterable');
var x = [1, 2, 3, 4];
[...xiterable.map(x, v => v * 2)];
// → [2, 4, 6, 8]