Object Oriented Programming - Remember to Set the Constructor Property when Changing the Prototype

Tell us what’s happening:
Describe your issue in detail here.

So I’m struggling to understand the practicality of this concept. Why does it matter whether duck.constructor === Bird show false, and how does it impact the usability of an object?

  **Your code so far**
function Dog(name) {
this.name = name;
}

// Only change code below this line
Dog.prototype = {
constructor: Dog,
numLegs: 4,
eat() {
  console.log("nom nom nom");
},
describe() {
  console.log("My name is " + this.name);
}
};
  **Your browser information:**

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36

Challenge: Object Oriented Programming - Remember to Set the Constructor Property when Changing the Prototype

Link to the challenge:

Edited the question, I think I mixed up the terms

Edited again, I think this better explains it

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.