Skip to content

Instantly share code, notes, and snippets.

@lateek35
Last active August 29, 2015 14:17
Show Gist options
  • Save lateek35/d4998b174a40a4788521 to your computer and use it in GitHub Desktop.
Save lateek35/d4998b174a40a4788521 to your computer and use it in GitHub Desktop.
var app = (function(){
var myPrivateVariable = "My private content";
var __private = {
bind: function(){
},
cache: function() {
// impl
}
};
var app = {
init: function(){
console.log(myPrivateVariable);
__private.cache();
__private.bind();
},
blabla: function(){
// ....
}
};
return app;
})();
app.init(); // > my private content
app.myPrivateVariable; // > undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment