Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var MyApp = {};
- MyApp.MyModule = function(arg1) {
- //Private methods
- var methodOne = function() {};
- var methodTwo = function() {};
- return (function() {
- var self = {};
- self.init = function() {
- console.log('hoistable/before: ' + hoistable); //returns undefined
- hoistable = arg1;
- console.log('hoistable/after: ' + hoistable); //returns value of arg1
- };
- return self;
- })();
- //Private variables
- var hoistable, anotherVar, yetAnother;
- }
Add Comment
Please, Sign In to add comment