Why is this? And if I’m doing something wrong with my prototype object, how would I correctly complete this challenge by creating an object prototype rather than adding the properties individually? Thank you!
Hi, thank you for the reply but I’m still pretty confused. I’m trying to use the principle taught from an earlier challenge that says it’s cleaner and more efficient to create the prototype as an object. The syntax that worked for this challenge is exactly the same as what I tried for the challenge my original post was about, yet it doesn’t work for this one?
Oh I see, thank you! Would you mind explaining it a bit more so I can understand it more thoroughly? Is it like the initial Dog.prototype object I created overwrites the Dog.prototype=Object.create(Animal.prototype); line before it, so I need to use the Object.assign() function to combine it rather than overwriting it? Is this always necessary for specific cases where I’m trying to use inheritance, and that’s why I didn’t need to do this for the earlier challenge?