Skip to content

Instantly share code, notes, and snippets.

@mralexho
Last active Nov 18, 2015
Embed
What would you like to do?
var myNamespace = (function () {
var myPrivateVar = 0;
var myPrivateMethod = function (someText) {
console.log(someText); };
return {
myPublicVar: "foo",
myPublicFunction: function (bar) {
myPrivateVar++;
myPrivateMethod(bar);
} };
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment