0

为什么第二行会抛出错误?

[0,1,2].forEach(function(x) { console.log(x) }); // prints 0, 1, 2
[0,1,2].forEach(console.log); // throws "TypeError: Illegal invocation"
4

0 回答 0