Skip to content

Instantly share code, notes, and snippets.

@abloom
Forked from robertwalsh0/module_pattern.js
Last active December 16, 2015 07:19
Show Gist options
  • Save abloom/5398064 to your computer and use it in GitHub Desktop.
Save abloom/5398064 to your computer and use it in GitHub Desktop.
function createMy() {
var my = {},
privateVariable = 1;
function privateMethod() {
// ...
}
my.moduleProperty = 1;
my.moduleMethod = function () {
// ...
};
return my;
}
var MODULE = createMy();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment