Aug 04, 2016 07:54
> [[1],[2,3]].reduce((a,b) => a.concat(b), [])
[ 1, 2, 3 ]
> Array.prototype.concat.call([1], [2,3])
[ 1, 2, 3 ]
> [[1],[2,3]].reduce(Array.prototype.concat.call, [])
TypeError: [[1],[2,3]].reduce is not a function
at Array.reduce (native)
at repl:1:13
...
Leave a comment
Comments 1
Reply
Leave a comment