Created
November 3, 2014 18:42
-
-
Save syzer/7eb549117f3291d9ff53 to your computer and use it in GitHub Desktop.
MakesSanwich
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 makeSandwich() { | |
var preparedFood = 'Here is a sandwich with: '; | |
return { | |
addLattice: function () { | |
// Lattice logic here | |
preparedFood += 'Lattice'; | |
return this; | |
}, | |
addBacon: function () { | |
preparedFood += 'Bacon'; | |
return this; | |
}, | |
addTomato: function () { | |
preparedFood += 'Tomato'; | |
return this; | |
}, | |
getFood: function () { | |
return preparedFood; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment