Skip to content

Instantly share code, notes, and snippets.

@VoloshchenkoAl
Created February 20, 2017 11:14
Show Gist options
  • Save VoloshchenkoAl/4ae4e6e7f84d3731dd33c2270425a552 to your computer and use it in GitHub Desktop.
Save VoloshchenkoAl/4ae4e6e7f84d3731dd33c2270425a552 to your computer and use it in GitHub Desktop.
function map$viaReduce (array, fn)
{
return array.reduce(function (memo, item, index, array)
{
return memo.concat([ fn(item, index, array) ]);
}, []);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment