Tell us what’s happening:
There’s error “cannot read property prototype undefined”
Plz explain what I’m doing wrong
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 (Linux; Android 5.1; Lenovo P1ma40) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.99 Mobile Safari/537.36
.
Challenge: Override Inherited Methods
Link to the challenge: