Created
January 3, 2017 04:50
-
-
Save bradparker/34c7bd8d627809333adcc3e02cd7f755 to your computer and use it in GitHub Desktop.
Flat Map
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 flatMap = (array, func) => ( | |
array.reduce((result, element) => ( | |
result.concat(func(element)) | |
), []) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment