15/30 Introduction to Objects


#1

Hello, can someone please help me to understand what it is that I am doing wrong. An error keeps saying that I haven't created the cat function.(Code below)
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!
Cat.meow()


#2

Cat is a function, it has no attribute meow, certainly no such function.

Consider what you want to do and google that to figure out what to write

There's a comment saying:
// add code here to make the cats meow!
Who/what are the cats, what does "the cats" refer to? And how can those be made to meow?


#3

you should not write
cat.meow
but you should write
gary.meow()
cheshire.meow()