Good Morning Campers…
So I need a small ball peen Hammer to get this little item into the brain please…
In the coding example… they give us :
Animal.prototype = {
constructor: Animal,
describe: function() {
console.log("My name is " + this.name);
}
};
Bird.prototype = {
constructor: Bird
};
Dog.prototype = {
constructor: Dog
};
The end result being that you create the supertype of " Animal " which will of course eliminate the repeated code in both the subtype objects… I get that…
I also get that in the usub versions, the prototype is inherited by the " new" descriptor for the constructor… but what I am missing is that although logically there is a new duck object, that is the new"Bird" object, if the supertype were Animal - how does the code connect Animal to Bird ?
Thanks in advance… the spirit is willing but head is hard LOL