Skip to content

Instantly share code, notes, and snippets.

@mralexho
Last active November 18, 2015 22:33
Show Gist options
  • Select an option

  • Save mralexho/fa3ce4f98791e41b8885 to your computer and use it in GitHub Desktop.

Select an option

Save mralexho/fa3ce4f98791e41b8885 to your computer and use it in GitHub Desktop.
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