var student={ name:"马云", say:function(){ console.log(this.name); } } var f=student.say; f.call(student);//马云 f.apply(student);//马云
function Person(name,age){ this.name=name; this.age=age; } Person.prototype.said=function(){ console.log(this.name); } var teacher=new Person(); var soldier={ name:"库里" }; teacher.said.apply(soldier);//库里 teacher.said.call(soldier);//库里