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