-
Notifications
You must be signed in to change notification settings - Fork 0
map
Subhajit Sahu edited this page Dec 28, 2022
·
17 revisions
Transform values of entries.
function map(x, fm)
// x: lists
// fm: map function (v, k, x)
const xlists = require('extra-lists');
var x = [['a', 'b', 'c', 'd'], [1, 2, 3, 4]];
xlists.map(x, v => v * 2);
// → [ [ 'a', 'b', 'c', 'd' ], [ 2, 4, 6, 8 ] ]