87,993
社区成员
发帖
与我相关
我的任务
分享
function eat(x, y) {
console.log(x + y);
console.log(this);
}
function drink(x, y) {
console.log(x - y);
console.log(this);
}
eat.call(drink, 3, 2);
function eat() {
this.x = 1;
this.y = 2;
// this.z = this.x + this.y;
console.log(this.z);
}
function drink() {
this.x = 2;
this.y = 3;
this.z = this.x + this.y;
console.log(this);
}
eat.call(drink);
var d = new drink();
eat.call(d)
