Last active
August 29, 2015 14:17
-
-
Save lateek35/d4998b174a40a4788521 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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