function inheritProto(child,parent){
const newObj = Object.create(parent.prototype)
newObj.constructor = child
child.prototype = newObj
}
function Parent(name){
this.name = name
this.colors = ['yellow','blue','red']
}
Parent.prototype.getName = function(){
return this.name
}
function Child(name,age){
Parent.call(this,name)
this.age = age
}
inheritProto(Child,Parent)
const a = new Child('1',12)
a.colors.push('green')
const b = new Child('2',13)
console.log(a.getName())
console.log(b)