Object Oriented Programming - Understand Where an Object’s Prototype Comes From

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

This is more for understanding.

This sections shows us that an object inherits its prototype directly from the constructor function that created it.

Is this why when we change a prototype to a new object we have the issue where the constructor property is erased and defaulted to Object if we don’t specify the constructor? Because the object we are setting the prototype to is just that, an Object?

Your code so far

function Dog(name) {
  this.name = name;
}

let beagle = new Dog("Snoopy");

// Only change code below this line

Your browser information:

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

Challenge: Object Oriented Programming - Understand Where an Object’s Prototype Comes From

Link to the challenge:

hello and welcome to fcc forum :slight_smile:

please explain this with an example, that way its more helpful, happy learning :slight_smile:

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