Skip to content

Instantly share code, notes, and snippets.

@SergeiStruk
Last active August 29, 2015 14:24
Show Gist options
  • Save SergeiStruk/9da1ca2e22acb4c5edd0 to your computer and use it in GitHub Desktop.
Save SergeiStruk/9da1ca2e22acb4c5edd0 to your computer and use it in GitHub Desktop.
var obj = (function() {
var func1 = function(options) {
...
},
func2 = function(options) {
...
},
func3 = function(options) {
...
func1();
};
func4 = function(options) {
...
func1();
func2();
};
//This is a list of public functions, other ones (func1, func2) are private.
//You will have ability to invoke only func3 and func4 for obj.
return {
func3: func3,
func4: func4,
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment