Skip to content

Instantly share code, notes, and snippets.

@panw
Created July 17, 2015 05:14
Show Gist options
  • Save panw/30731b0b5df35f432a5e to your computer and use it in GitHub Desktop.
Save panw/30731b0b5df35f432a5e to your computer and use it in GitHub Desktop.
function Dog() {
this.name = "Lassie";
this.greeting = "woof";
this.greet = function() {
console.log(this.name, "says", this.greeting);
};
this.eat = function() {
console.log(this.name, "is eating");
};
this.sleep = function() {
console.log(this.name, "is sleeping");
};
}
function Cat() {
this.name = "Felix";
this.greeting = "meow";
this.greet = function() {
console.log(this.name, "says", this.greeting);
};
this.eat = function() {
console.log(this.name, "is eating");
};
this.sleep = function() {
console.log(this.name, "is sleeping");
};
}
function Cat() {
this.name = "Tony";
this.greeting = "rawwr!!!";
this.greet = function() {
console.log(this.name, "says", this.greeting);
};
this.eat = function() {
console.log(this.name, "is eating");
};
this.sleep = function() {
console.log(this.name, "is sleeping");
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment