Skip to content

Instantly share code, notes, and snippets.

@mralexho
Created December 26, 2014 16:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mralexho/4feb06a440527b6d10cc to your computer and use it in GitHub Desktop.
Save mralexho/4feb06a440527b6d10cc to your computer and use it in GitHub Desktop.
javascript pattern
/**
* 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