Created
December 26, 2014 16:59
-
-
Save mralexho/4feb06a440527b6d10cc to your computer and use it in GitHub Desktop.
javascript pattern
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
/** | |
* Self-executing JavaScript pattern | |
*/ | |
// undefined = true; works in javascript | |
// passing undefined as a param guarantees undefined is “undefined” | |
(function(window, document, undefined) { | |
// ... | |
})(this, document); // this = window |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment