Skip to content

Instantly share code, notes, and snippets.

@FiNGAHOLiC
Created January 13, 2012 12:09
Show Gist options
  • Save FiNGAHOLiC/1605795 to your computer and use it in GitHub Desktop.
Save FiNGAHOLiC/1605795 to your computer and use it in GitHub Desktop.
Immediately invoked function expressions
// http://speakerdeck.com/u/addyosmani/p/large-scale-javascript-application-architecture
(function(){
// code to be immediately invoked
}()); // Crockford recommend this way
(function(){
// code to be immediately invoked
})(); // This is just as valid
(function(window, document, undefined){
// code to be immediately invoked
})(this, this.document);
(function(global, undefined){
// code to be immediately invoked
})(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment