JS 的 new 做了什么

137 阅读1分钟
  1. 创建临时对象/新对象
  1. 绑定原型
  1. 指定 this = 临时对象
  1. 执行构造函数
  1. 返回临时对象