Exercise 4.4


why will this only pass me if I use a lower case penguin see below.
var penguin = new Penguin("Bob"); vs var Penguin = new Penguin("Bob");

// 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 Penguin("Bob");


It will only work if you put the variable lower-cased because you already put Penguin as a function AND a prototype for it:

Therefore, if you put the variable capitalized, it would make those two things function.


Thank you for the help.