Created
October 7, 2013 23:00
-
-
Save stevencombs/6876462 to your computer and use it in GitHub Desktop.
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
// Javascript Getting Started with Programming | |
// A Codecademy Javascript (Prototype Practice - Objects) assignment | |
// Dr. Steven B. Combs, coding novice | |
function Cat(name, breed) { | |
this.name = name; | |
this.breed = breed; | |
} | |
// Cat Objects | |
var cheshire = new Cat("Cheshire Cat", "British Shorthair"); | |
var gary = new Cat("Gary", "Domestic Shorthair"); | |
// Meow Method | |
Cat.prototype.meow = function () { | |
console.log ("Meow!"); | |
}; | |
// Cats Meow | |
cheshire.meow(); | |
gary.meow(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment