- 创建一个新的空对象
- 将空对象的proto 指向了 Person.prototype
- 将构造函数内部的this指向新对象
- 执行构造函数给this(实例对象)添加属性或方法
- 默认return this
function Person(name,age){
this.name = name
this.age = age
}
Person.prototype.say = function(){
console.log('说话')
}
var zs = new Person('张三',20)