Last active
June 3, 2017 14:10
-
-
Save maurobringolf/ec5c633d91420a8ee5b7203b34a77d8c to your computer and use it in GitHub Desktop.
Created for this post: https://maurobringolf.ch/2017/06/implementing-map-filter-and-find-with-reduce-in-javascript/
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
function map(arr, fn) { | |
return arr.reduce((acc, item) => […acc, fn(item)], []) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment