15/30 Prototype Practice


Maybe I'm tired, but I can't figure out what I'm missing.

Oops, try again. It looks like you have an error in your code. Here's the message: ReferenceError: cat is not defined
ReferenceError: cat is not defined

unction Cat(name, breed) {
    this.name = name;
    this.breed = breed;
var cheshire = new Cat("Cheshire Cat", "British Shorthair");
var gary = new Cat("Gary", "Domestic Shorthair");


cat is undefined. Were we to write, Cat.meow() it would raise an exception something like,

Cat has no attribute or method, `meow()`.

We would never call the constructor to run a method. Create an instance and call the method on that object.

Try with 'cheshire' or 'gary'...



Ugh Thank you. The instructions of each of these lessons are killing me.


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