天天看點

new操作符做了什麼?

function Test(){ this.name = 'lishishi' } var obj = new Test()     var obj = { name:'lishishi' } function Test(param){ console.log(this); console.log(param) } obj.__proto__ = Test.prototype Test.call(obj,123)    

轉載于:https://www.cnblogs.com/MDGE/p/11421445.html