0

我假设#apply 是在 Function.prototype 中定义的,我用如下代码覆盖它:

Function.prototype.apply = undefined;

然后,我用 FireBug 测试它!

var a1 = [];
var a2 = [3];
console.log(a1.push.apply); // output: undefined
console.log(a2.push.apply); // output: apply()
console.log(typeof a1.push.apply); // output: "undefined"
console.log(typeof a2.push.apply); // output: "function"

怎么会这样,真的让我很困惑!如果有另一个#apply并存?

4

0 回答 0