This solution seems like it would overwrite the fact that Bird is a subtype of animal. Surely we don’t want this. What am i not understanding?
Your code so far
function Animal() { }
function Bird() { }
function Dog() { }
Bird.prototype = Object.create(Animal.prototype);
Dog.prototype = Object.create(Animal.prototype);
// Only change code below this line
let duck = new Bird();
let beagle = new Dog();
Bird.prototype.constructor=Bird;
Dog.prototype.constructor=Dog;
console.log(beagle.constructor)
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36 Edg/111.0.1661.41
Challenge: Object Oriented Programming - Reset an Inherited Constructor Property
Link to the challenge: