Object Oriented Programming - Override Inherited Methods

Please Solve my code i try so so many time but it’s shows syntax error i don’t know what to do please solve.

Your code so far

function Bird(){}
Bird.prototype.fly=function(){return "I am flying!";};
function penguin(){}
penguin.prototype=object.create(Bird.prototype);
penguin.prototype.constructor=penguin;
//only change code below this line
penguin.prototype.fly=function(){
return 'Alas,this is a flightless bird.'}
//---------------------
penguin=new penguin();
console.log(penguin.fly());


Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36

Challenge Information:

Object Oriented Programming - Override Inherited Methods

  • typo, make “penguin” capitalize

happy coding :slight_smile:

Hello @Garimatomar !

To add to the previous guidance, please capitalize O in ```object.create?

Suggestion is to reset the lesson, and only add the necessary code, with proper capitalization, and not change anything else.

Happy coding!

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