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