вгадай мову по wtf

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

valyakol August 16 2016, 08:07:23 UTC
TypeError: It may be Ecma script 5 or 6.

Reply


Leave a comment

Up