<分区>
当我在 Chrome 18 beta 中执行以下代码时出现错误:
console.log.apply(this, ['message']);
TypeError: Illegal invocation.
在 Firefox 10 中,它按预期工作。
在 IE9 中,我收到错误:对象不支持“应用”属性或方法
。
我猜这与浏览器如何实现 console.log
有关。
为什么它在 Firefox 中有效,但在 Chrome 和 IE 中无效?我希望有人能阐明造成这种情况的原因及其后果。
这里是 an executable sample在 JS Bin 上。