let obj = {name:'zzt'};
function fn() {
console.log(this.name);
}
Function.prototype.MyCall = function (context) {
context.foo = this;
context.foo();
delete context.fn;
};
fn.MyCall(obj);
这段代码中,为什么 this 代表的是 fn 函数,传递给 context
