Last active
December 21, 2017 17:39
-
-
Save premithk/f85ecbed1f10948817e199f3ba64c352 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
const map_recursive = (map_function, array) => | |
!array.length | |
? [] | |
: [map_function(array[0])].concat( | |
map_recursive(map_function, array.slice(1)) | |
); | |
map_recursive(x=>x+1, [1,2,3,4]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment