Black and white penguin magic


im am not getting an error message. in fact it says i passed the exercise but nothing prints out on the console screen. am i doing something wrong?

// the original Animal class and sayName method
function Animal(name, numLegs) { = name;
    this.numLegs = numLegs;
Animal.prototype.sayName = function() {
    console.log("Hi my name is " +;

// define a Penguin class
function Penguin(name) { = name;
    this.numLegs = 2;

// set its prototype to be a new instance of Animal
Penguin.prototype = new Animal();

var penguin = new Penguin("Spike");


The code appears to be all in order and works as expected in the lab.

Hi my name is Spike

Did your session perhaps time out? Try to refresh the page and submit again.


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