Created
August 23, 2012 01:53
-
-
Save ericelliott/3431213 to your computer and use it in GitHub Desktop.
IIFE Syntax
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
// 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 | |
}(); |
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
It might be helpful to note that non-paren styles are useful in semicolon-free code.