Skip to content

Instantly share code, notes, and snippets.

@adamnoffie
Created May 14, 2010 17:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save adamnoffie/401406 to your computer and use it in GitHub Desktop.
Save adamnoffie/401406 to your computer and use it in GitHub Desktop.
// what does this do?:
(function(){
var i = 5;
}());
// is it like a javascript hack equivalent to the jQuery(document).ready()? e.g.:
$(function() {
var i = 5;
});
@JavaScript-Packer
Copy link

(function(){alert("WHAK.com")}()); is a auto running function, see it live on http://jsfiddle.net/d48jb6yw/.

Closure controller? This technically is called a wrapped "IIFE". This stands for Immediately Invoked Function Expression, more on https://en.wikipedia.org/wiki/Immediately-invoked_function_expression

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment