Last active
December 1, 2017 11:16
-
-
Save gilesbradshaw/30b44679d5f2ae3d0bdafda74766d171 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function map(func) { | |
return this.reduce( | |
(acc, val) => [ | |
...acc | |
func(val), | |
], | |
[], | |
); | |
} | |
[1, 2, 3]::map(x => x +1) | |
/* | |
[2,3,4] | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment