Skip to content

Instantly share code, notes, and snippets.

@appkr
Last active August 29, 2015 14:14
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 appkr/e0ec4b5c83df925e6e21 to your computer and use it in GitHub Desktop.
Save appkr/e0ec4b5c83df925e6e21 to your computer and use it in GitHub Desktop.
JavaScript Protytypal Inheritance 2 from CodeSchool// source http://jsbin.com/qofali
var Shoe = function(shoeSize, shoeColor, forGender, constructStyle) {
this.size = shoeSize;
this.color = shoeColor;
this.gender = forGender;
this.construction = constructStyle;
};
Shoe.prototype = {
putOn: function() {
alert("Your " + this.construction + "'s " + "on, dude!");
},
takeOff: function() {
alert("Phew! Somebody's size " + this.size + "'s " + "are fragrant!");
}
};
/*
var beachShoe = new Shoe(10, "blue", "women", "flipflop");
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment