Created
February 4, 2011 17:01
Self Executing Anonymous Function
This file contains 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
(function() { | |
doSomething(); | |
})() | |
// or ... | |
//NOTE: This is basically doing the same thing, but we can gain a tiny bit performance, because we directly | |
//pass the current window, and document instances to the function, instead of making it iterate | |
//through the scope | |
(function(window,document,undefined) { | |
doSomething(); | |
})(this,document) // these are the arguments being passed to the function at the beginning | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment