Created
November 5, 2009 16:16
-
-
Save subtleGradient/227165 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
// Basic closure, assumes window === this | |
(function(){ | |
// require stuff here | |
})(); | |
// Custom closure, this === anything you want | |
(function(){ | |
// require stuff here | |
}).apply(this.global || this); | |
// Custom closure fn, no call. Load the code in one context and then execute it in another | |
function Moo(){ | |
// require stuff here | |
}; | |
Moo.apply(this); | |
Moo.apply(context1); | |
Moo.apply(context2); | |
Moo.apply(context3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment