Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created February 17, 2017 16:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codecademydev/4fb61c79f4091864f4ba3b7bfd2b909b to your computer and use it in GitHub Desktop.
Save codecademydev/4fb61c79f4091864f4ba3b7bfd2b909b to your computer and use it in GitHub Desktop.
Codecademy export
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