Skip to content

Instantly share code, notes, and snippets.

@martianinteractive
Created March 1, 2013 16:14
Show Gist options
  • Save martianinteractive/5065693 to your computer and use it in GitHub Desktop.
Save martianinteractive/5065693 to your computer and use it in GitHub Desktop.
var myInstance = (function() {
var privateVar = '';
function privateMethod () {
// ...
}
return { // public interface
publicMethod1: function () {
// all private members are accesible here
},
publicMethod2: function () {
}
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment