Skip to content

Instantly share code, notes, and snippets.

@mralexho
Last active November 18, 2015 22:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mralexho/fa3ce4f98791e41b8885 to your computer and use it in GitHub Desktop.
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