This quesiton is related to Object Oriented Programming: Add Methods After Inheritance.
I would like to create the dog.prototype object (like show in a previous challenge) but I don’t see how in include in this prototype object the inheritance to animal. I would have imagine something like that
Dog.prototype={
Object.create(Animal.prototype),
constructor:Dog,
bark:function(){ console.log(“woaf”);}
};
But cannot make it work. SO how one introduce the inheritance in the prototype object without having to put
Dog.prototype =Object.create(Animal.prototype);
Dog.prototype.constructor=Dog;
Dog.prototype.bark=function(){ console.log(“woaf”);}
Thanks a lot!