Skip to content

Instantly share code, notes, and snippets.

@ericelliott
Created August 23, 2012 01:53
Show Gist options
  • Save ericelliott/3431213 to your computer and use it in GitHub Desktop.
Save ericelliott/3431213 to your computer and use it in GitHub Desktop.
IIFE Syntax
// jQuery syntax: (outies)
(function () {
// your code here
})();
// Crockford syntax: (innies)
(function () {
// your code here
}());
// Void syntax: (voiders)
void function () {
// your code here
}();
// Bang syntax (my favorite)
!function () {
// your code here
}();
Copy link

ghost commented Aug 23, 2012

It might be helpful to note that non-paren styles are useful in semicolon-free code.

@max-mapper
Copy link

i am a semicolonlesser and write them like this:

;(function () {})()

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