Created
December 11, 2014 05:55
-
-
Save CH34MKE10/4c3487ffa0dd715cd406 to your computer and use it in GitHub Desktop.
Sandwich JS
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
function Sandwich(bread, veggies, meat, dressing) { | |
this._bread = bread; | |
this._veggies = veggies; | |
this._meat = meat; | |
this._dressing = dressing; | |
} | |
Sandwich.prototype.getOrder = function ( ) { | |
var order = { | |
bread: this._bread, | |
veggies: this._veggies, | |
meat: this._meat, | |
dressing: this._dressing | |
} | |
return order; | |
} | |
var myVeggies = ["lettuce","spinach","tomato"]; | |
var mySandwich = new Sandwich("wheat", myVeggies, "turkey", "mustard"); | |
var myOrder = mySandwich.getOrder(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment