Last active
August 29, 2015 14:15
-
-
Save mralexho/b05371e130d61fcf1b6d to your computer and use it in GitHub Desktop.
a singleton module
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 singleton = function() { | |
var privateVariable; | |
function privateFunction(x) { | |
...privateVariable... | |
} | |
return { | |
first method: function (a, b) { | |
...privateVariable... | |
}, | |
second method: function (a, b) { | |
...privateFunction()... | |
} | |
}; | |
}(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment