天天看点

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