0 points
Submitted by Kyle
over 8 years

Am I missing something here? Keeps getting an error

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

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

// set its prototype to be a new instance of Animal

Penguin.prototype = new Animal();

var penguin = new Penquin(“click click click”); penguin.sayName();

It keeps giving me: ReferenceError: Penquin is not defined Oops, try again.

Answer 5137cfe58fde443281004601

2 votes

Permalink

Never mind… i found the problem…. this is embarrasing….

points
Submitted by Kyle
over 8 years

3 comments

brycesipes over 8 years

Haha. I see it. “q” instead of “g”. Isn’t that the worst?! You can spend so long looking for such a simple mistake that is so easy to miss.

ace over 8 years

THAT IS FREAKIN FUNNY

Harshit Jain over 8 years

I am feeling pain in my stomach after laughing so much. :D

Answer 5145068ace2e0ffdb70015bf

0 votes

Permalink

this code didn’t work for me..even though i changed the q to a p

points
Submitted by <3Packers_Apple12
over 8 years