Skip to content
Subhajit Sahu edited this page May 9, 2020 · 17 revisions

Updates values based on map function. 🏃 📼 📦 🌔

map.map$(x, fn, [ths]);
// x:   a map (updated)
// fn:  map function (v, k, x)
// ths: this argument
// --> x
const map = require('extra-map');

var x = new Map([['A', 1], ['B', 2], ['C', -3]]);
map.map$(x, v => v * 2);
// Map(3) { 'A' => 2, 'B' => 4, 'C' => -6 }

x;
// Map(3) { 'A' => 2, 'B' => 4, 'C' => -6 }
Clone this wiki locally