FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

map · nodef/extra-array Wiki · GitHub

Subhajit Sahu edited this page May 3, 2023 · 24 revisions

Transform values of an array.

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


function map(x, fm)
// x:  an array
// fm: map function (v, i, x)
const xarray = require('extra-array');

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


References

Wiki pages Pages 196

Clone this wiki locally


Back | FazBrowse Home | New Git URL