15. Prototype Practice


#1

Link : https://www.codecademy.com/en/courses/objects-ii/2/5?curriculum_id=506324b3a7dffd00020bf661#

ReferenceError: chesire is not defined

function Cat(name, breed) {
    this.name = name;
    this.breed = breed;
}


// let's make some cats!
var cheshire = new Cat("Cheshire Cat", "British Shorthair");
var gary = new Cat("Gary", "Domestic Shorthair");

// add a method "meow" to the Cat class that will allow
// all cats to print "Meow!" to the console
Cat.prototype.meow = function() {
    console.log("Meow!");
};
// add code here to make the cats meow!

chesire.meow();
gary.meow();

What's wrong with this? Please help..


#2

type error

you declare " cheshire = new Cat(...) "

and you call " chesire.meow(); "


#3

and

Look carefully on the declaration of your variable.


#4

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