js function call

2021-06-22  

var user = {
    info: function() {
        console.log(this.name + " " + this.age);
    }
}
var user1 = {
    name:"xj",
    age: "22",
}

user.info.call(user1);//打印 xj 22

 

ConstXiong 备案号:苏ICP备16009629号-3