15. Prototype Practice


#1

Prototype Practice

Hey,

My code has a syntax error somewhere but I really cant find it.
Thanks for replying I just want to meow!


unction 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!
cheshire.meow();
gary.meow();


#2

here:

Cat.prototype.meow = function {

function() requires parentheses. and i assume that unction (line 1) is a copy mistake


#3

Thanks man! it worked <3


#4