@extra-array/map-update.min

Updates values based on map function. :package: :smiley_cat: :running: :vhs: :moon: :scroll: :newspaper: :blue_book:

Usage no npm install needed!

<script type="module">
  import extraArrayMapUpdateMin from 'https://cdn.skypack.dev/@extra-array/map-update.min';
</script>

README

Updates values based on map function. :package: :smiley_cat: :running: :vhs: :moon: :scroll: :newspaper: :blue_book:

Alternatives: map, map$.
Similar: map, filter, reject, reduce, accumulate.

This is part of package extra-array.

This is browserified, minified version of @extra-array/map-update.
It is exported as global variable array_map$.
CDN: unpkg, jsDelivr.


array.map$(x, fm);
// x:  an array (updated)
// fm: map function (v, i, x)
// → x
const array = require("extra-array");

var x = [1, 2, 3, 4];
array.map$(x, v => v * 2);
// [ 2, 4, 6, 8 ]

x;
// [ 2, 4, 6, 8 ]


References