Skip to content

Instantly share code, notes, and snippets.

@brschwar
Last active December 24, 2015 01:29
Show Gist options
  • Save brschwar/6724515 to your computer and use it in GitHub Desktop.
Save brschwar/6724515 to your computer and use it in GitHub Desktop.
Revealing Module Pattern
// module declaration
var Module = (function () {
var _privateFunction = function () {
// private logic
};
var publicFunction = function () {
// public logic
};
// publicly exposed API (revealed)
return {
public: publicFunction
};
})();
// usage
Module.public();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment