Skip to content

Instantly share code, notes, and snippets.

@geastwood
Created May 1, 2014 19:02
Show Gist options
  • Save geastwood/11459011 to your computer and use it in GitHub Desktop.
Save geastwood/11459011 to your computer and use it in GitHub Desktop.

Why passing undefined to Immediately invoking function

(function(window, document, undefined) {...})(window, document);
  • save undefined variable from redeclearation
  • save bit from minification, since the variables will be replaced with shorter alias.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment