Created
September 3, 2013 23:28
-
-
Save esmevane/6430962 to your computer and use it in GitHub Desktop.
[ CoffeeScript ] Singleton example with private functions
This file contains hidden or 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
SingletonExample = | |
do -> | |
privateFunction = -> "I'm so hidden" | |
publicFunction = -> alert privateFunction() | |
publicFunction: publicFunction | |
SingletonExample.publicFunction() | |
alert SingletonExample.privateFunction() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment