Last active
August 29, 2015 14:13
-
-
Save why-jay/2667836a895db184e1b2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// immutable version | |
const map = arr => | |
arr.reduce((prev, cur) => prev.concat(cur), []); | |
// mutable version | |
const map = arr => | |
arr.reduce((prev, cur) => { | |
prev.push(cur); | |
return prev; | |
}, []); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment