-
-
Save codecademydev/4fb61c79f4091864f4ba3b7bfd2b909b to your computer and use it in GitHub Desktop.
Codecademy export
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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! | |
cheshire.meow(); | |
gary.meow(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment