function Parent(name,age){
this.name = name
this.age = age
}
function Child(){
Parent.apply(this)
}
Child.prototype = Object.create(Parent.prototype)
Child.prototype.constructor = Child
let p =new Parent()
let c = new Child()
es5继承最优组合function Parent(name,age){ this.name = name this.age = age}function Child(){ Parent.apply(this) }Child.prototype = Object.create(Parent.prototype)Child.prototype.constructor = Child let p =new Parent()let c = new Child()