1. function Parent(name) {
    2. this.name = name;
    3. this.colors = ['red','blue','yellow']
    4. }
    5. Parent.prototype.getName = function () {
    6. console.log(this.name);
    7. }
    8. function Child(name) {
    9. Parent.call(this,name)
    10. }
    11. Child.prototype = Object.create(Parent.prototype)
    12. Child.prototype.constructor = Child;
    13. const child = new Child('wbt')
    14. child.getName()