标签:
疑问:在使用.call()时,调用对象到底是否可以直接拥有了被调用者的方法和属性?
这里输出结果为:ReferenceError: o is not defined
function Person(name,age,job){ this.name=name; this.age=age; this.job=job; this.sayName= function() { console.log(this.name); }; return this; } Person.call(o,"nike",20,"student"); o.sayName();
标签:
原文地址:http://www.cnblogs.com/web-coding/p/4722841.html