My code doesn't log anything to the console. Why?


It doesn't log anything to the console and I followed all instructions to the latter. Please help me find the error.

// create your Animal class here
function Animal(name,numLegs){;

// create the sayName method for Animal
Animal.prototype.sayName =function(){
    console.log("Hi my name is "+;

// provided code to test above constructor and method
var penguin = new Animal("Captain Cook", 2);


Wow, that's surprising. I just ran your code and it worked perfectly. Refresh page.


I refreshed and it worked. Thanks



You're welcome. Have fun coding! :slight_smile:


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