UNPKG

1.77 kBMarkdownView Raw
1Updates values based on map function.
2[:package:](https://www.npmjs.com/package/@extra-set/map)
3[:smiley_cat:](https://github.com/orgs/nodef/packages?repo_name=extra-set)
4[:running:](https://npm.runkit.com/@extra-set/map)
5[:vhs:](https://asciinema.org/a/339338)
6[:moon:](https://www.npmjs.com/package/@extra-set/map.min)
7[:scroll:](https://unpkg.com/@extra-set/map/)
8[:newspaper:](https://nodef.github.io/extra-set/)
9[:blue_book:](https://github.com/nodef/extra-set/wiki/)
10
11> Alternatives: [map], [map$].<br>
12> Similar: [map], [reduce], [filter], [filterAt], [reject], [rejectAt].
13
14> This is part of package [extra-set].
15
16[extra-set]: https://www.npmjs.com/package/extra-set
17
18<br>
19
20```javascript
21set.map(x, ft);
22// x: a set
23// ft: map function (v, v, x)
24```
25
26```javascript
27const set = require("extra-set");
28
29var x = new Set([1, 2, 3, 4]);
30set.map(x, v => v * 2);
31// Set(4) { 2, 4, 6, 8 }
32```
33
34<br>
35<br>
36
37
38## References
39
40- [Data.List.map: Haskell](https://hackage.haskell.org/package/base-4.12.0.0/docs/Data-List.html#v:map)
41- [Array.prototype.map: MDN web docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)
42- [array_map: PHP](https://www.php.net/manual/en/function.array-map.php)
43- [Array.map: sugarjs](https://sugarjs.com/docs/#/Array/map)
44- [filter-collection: @dimd13](https://www.npmjs.com/package/filter-collection)
45
46[map]: https://github.com/nodef/extra-set/wiki/map
47[map$]: https://github.com/nodef/extra-set/wiki/map$
48[reduce]: https://github.com/nodef/extra-set/wiki/reduce
49[filter]: https://github.com/nodef/extra-set/wiki/filter
50[filterAt]: https://github.com/nodef/extra-set/wiki/filterAt
51[reject]: https://github.com/nodef/extra-set/wiki/reject
52[rejectAt]: https://github.com/nodef/extra-set/wiki/rejectAt