Created
October 19, 2010 20:59
-
-
Save dsimard/635109 to your computer and use it in GitHub Desktop.
Simple singleton
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 instance = { | |
msg : "Hello world!", | |
hello : function() { | |
alert(instance.msg); | |
} | |
} | |
instance.hello(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment