Created
March 20, 2016 02:52
-
-
Save JasonDeving/bf8bfb60e31b9561c829 to your computer and use it in GitHub Desktop.
Toaster
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 Toaster = function(){ | |
//some private methods and properties | |
var maxTemp = 500, | |
temp: 0; | |
return { | |
//some public methods and properties, etc | |
setTemp: function(newTemp) { | |
if (newTemp > maxTemp) { | |
console.log("That temp is too high!"); | |
} else { | |
temp = newTemp; | |
} | |
} | |
}; | |
}; | |
var myToaster = Toaster(); | |
myToaster.setTemp(300); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment