We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9beadbb commit aacb4c9Copy full SHA for aacb4c9
exercises/implement_map_with_reduce/solution/solution.js
@@ -1,5 +1,6 @@
1
module.exports = function map(arr, fn, thisArg) {
2
return arr.reduce(function(acc, item, index, arr) {
3
- return acc.concat(fn.call(thisArg, item, index, arr))
+ acc.push(fn.call(thisArg, item, index, arr))
4
+ return acc
5
}, [])
6
}
0 commit comments