function foo(){
return () => {
console.log(this.a);
}
}
const laowang = {
a : 10
}
const xiaozhang = {
a : 886
}
var fn = foo.call(xiaozhang);
fn(); //886
fn.call(laowang); //886
const a = () => {
console.log(this);
}
obj = {a};
a();
obj.a();
obj.a.call(null);
image.png
网友评论