JavaScript中new究竟做了什么?

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