Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@extra-array/map-update

nodef1.6kMIT2.10.19TypeScript support: included

Updates values based on map function.

extra, array, map, update, map$

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.


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