All in the Genes, 16/30


#1

Here is my code:

// create your Animal class here
function Animal (name, numLegs) {
this.name = name;
this.numLegs = numLegs;
};

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

// create the sayName method for Animal

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

I passed, but why isn't it printing out anything to the console?


#2

@michael_dhw,

Have you tried.....

++++ reset of session *****************
As you are manipulating with objects
under certain circumstances you can shoot your Browser in an
inconsistent state.

Therefor it is of an advantage to know that you have 2 reset facilities:

One is the use of the F5-key which does a refresh Browser

and

Two, select&copy your code
Then use the Reset Code button of the course-window,
then paste your code back in.

Addendum
General Notes:
Always refresh the browser after making corrections:
CTRL f5 ( if on Windows or Linux)
CMD r ( if on a MAC).
CTRL 0 to reset browser zoom