# js 中在 new 的时候发生了什么
Issue
欢迎在 Issue 中交流与讨论: Issue 341 (opens new window)
Author
- 创建了一个新对象
- 链接到原型
- 绑定this指向 4.返回这个对象
function _new() {
let obj = {}
let Con = [].shift.call(arguments)
obj.__proto__ = Con.prototype
let result = Con.apply(obj, arguments)
return typeof obj === 'object' ? obj : {}
}