Last active
August 29, 2015 14:14
-
-
Save appkr/e0ec4b5c83df925e6e21 to your computer and use it in GitHub Desktop.
JavaScript Protytypal Inheritance 2 from CodeSchool// source http://jsbin.com/qofali
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
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