摘要: new 操作符做了以下事情: 1.创建一个对象,将对象赋值给this 2.执行构造函数的代码,将构造器中的this.prop属性添加到this上 3.为this对象设置原型为其f.prototype 设置构造函数的constructor指向构造函数本身 4.隐式return this 先证明new 阅读全文
posted @ 2019-01-18 22:50 兴趣使然的Geek 阅读(558) 评论(0) 推荐(0) 编辑