Black (and White) Penguin Magic


// 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
var penguin = function(name, numLegs) { = name;
this.numLegs = 2;

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

var Penguin = new penguin("Bobby");


It's telling me: Your code threw the following error: TypeError: Right-hand side of 'instanceof' is not callable
Can somebody help me?

The code worked btw, but it's just telling me this error.


var penguin = new Penguin("Boddy");



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