-
Notifications
You must be signed in to change notification settings - Fork 3
map$
Subhajit Sahu edited this page Jun 12, 2020
·
12 revisions
Updates values based on map function. 🏃 📼 📦 🌔 📒
Alternatives: [map], [map$].
Similar: [map], [reduce], [filter], [filterAt], [reject], [rejectAt].
array.map(x, fn, [ths]);
// x: an array
// fn: map function (v, i, x)
// ths: this argumentconst object = require('extra-object');
var x = {a: 1, b: 2, c: 3, d: 4};
object.map$(x, v => v * 2);
// { a: 2, b: 4, c: 6, d: 8 }
x;
// { a: 2, b: 4, c: 6, d: 8 }