15. Prototype Practice


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() {
// add code here to make the cats meow!


What's wrong with this? Please help..


type error

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

and you call " chesire.meow(); "



Look carefully on the declaration of your variable.


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