Skip to content

Instantly share code, notes, and snippets.

@kpuputti
Created June 16, 2011 13:44
Show Gist options
  • Save kpuputti/1029253 to your computer and use it in GitHub Desktop.
Save kpuputti/1029253 to your computer and use it in GitHub Desktop.
Javascript module pattern
var namespace = {};
namespace.module = (function () {
var priv = 'private var';
return {
init: function () {
// init module
},
getPriv: function () {
return priv;
}
};
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment