-
Notifications
You must be signed in to change notification settings - Fork 1
map
Subhajit Sahu edited this page May 19, 2020
·
26 revisions
Updates values based on map function. 🏃 📼 📦 🌔 📒
Similar: map, filter, reduce, accumulate.
iterable.map(x, fn, [ths]);
// x: an iterable
// fn: map function (v, i, x)
// ths: this argument
const iterable = require('extra-iterable');
var x = [1, 2, 3, 4];
[...iterable.map(x, v => v * 2)];
// [ 2, 4, 6, 8 ]