Object Oriented Programming - Reset an Inherited Constructor Property

Tell us what’s happening:
Hi, I don’t understand why I am getting errors when running my code. This code is, however, the correct code. I only see 3 dots under the letter ‘B’ (from ‘Bird’) → see screenshot. Am I doing something wrong in the freeCodeCamp editor?

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
Bird.prototype.constructor = Bird;
Dog.prototpye.constructor = Dog;


let duck = new Bird();
let beagle = new Dog();

Your browser information:

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

Challenge: Object Oriented Programming - Reset an Inherited Constructor Property

Link to the challenge:

I would reset the code and make sure you make zero changes above the line telling you to not make changes.

You just have a typo on this line:

Dog.prototpye.constructor = Dog;

You put prototpye instead of prototype. That’s all!

1 Like

Thank you very much… What a stupid error… I think I need a new pair of glasses.

1 Like

Thanks for your reaction, Jeremy. It was just a stupid typo error… (prototpye instead of prototype)

It’s one of those things that’s hard to spot for anyone! haha Happy Coding! =]

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