Marching penguins


It gives me ok, but the code doesn't print any message

function Animal(name, numLegs) { = name;
    this.numLegs = numLegs;
Animal.prototype.sayName = function() {
    console.log("Hi my name is " +;

// create a Penguin constructor here

function Penguin (name, numLegs) { = name;
    this.numLegs = numLegs;


// create a sayName method for Penguins here
    Penguin.prototype.sayName = function () {
        console.log("Hi my name is " +;

// our test code
var theCaptain = new Penguin("Captain Cook", 2);


I just copied and pasted your code in the lesson and it passed fine ( i see your message about it not printing anything) However, it also prints Hi my name is Captain Cook so as far as I can tell it works just as it is supposed to. Try refreshing?


ok, still not printing but it's ok.
Was affraid might be some bug


Yeah as long as the lesson is passing and you can move on it is at least for now its ok. You know you have the right code and you coded it well so you haven't like passed lesson with a "cheap" or "cheat" code. Maybe, try passing it again tomorrow a fresh just to see if it will pass once let a lone.


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