Skip to content

Instantly share code, notes, and snippets.

@3emad
Forked from guilhermepontes/module-es2015.js
Created January 15, 2013 16:03
Show Gist options
  • Save 3emad/4539694 to your computer and use it in GitHub Desktop.
Save 3emad/4539694 to your computer and use it in GitHub Desktop.
var app;
app = (function(){
var myPrivateVariable = "my private content";
var application = {
init: function(){
console.log(myPrivateVariable);
},
cache: function() {
// impl
},
bind: function() {
// impl
},
blabla: function(){
// ....
}
}
return application;
})();
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