UNPKG
es5-workshop
Version:
latest (1.0.0)
1.0.0
NodeSchool ES5 Workshop
github.com/timoxley/es5-workshop
timoxley/es5-workshop
es5-workshop
/
exercises
/
array-map-with-reduce
/
solution.js
8 lines
(6 loc)
•
155 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
function
map
(arr, fn)
{
return
arr.reduce(
function
(acc, item, index, arr)
{
return
acc.
concat
(fn(item, index, arr)) }, []) }
module
.exports = map