Mercy Please help. Is leonhard_wettengmx_n available?


#1

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

// create a Penguin constructor here
function Penguin(name, numLegs){
this.name = name;
this.numLegs = numLegs;
}

// create a sayName method for Penguins here
Penguin.prototype.sayName = function() {
console.log("Hi my name is" + this.name);
};

// our test code
var theCaptain = new Penguin("Captain Cook", 2);
theCaptain.sayName();


#2

You can call him like this @leonhard_wettengmx_n :smile:


#3

should be

console.log("Hi my name is " + this.name);

#4

woah.Thank you sir! thats awesome!