Tell us what’s happening:
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";
};
// Only change code above this line
let 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/86.0.4240.198 Safari/537.36 Edg/86.0.622.69
.
Challenge: Override Inherited Methods
Link to the challenge: