Created
December 10, 2013 17:09
-
-
Save jonnybojangles/7894221 to your computer and use it in GitHub Desktop.
What are the key differences between these two self-invoking functions?
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
!function(a){console.log(a)}('Hello'); // Returns function statement Hello and true | |
// VS | |
(function(a){console.log(a)})('World'); // Returns function statement: World and undefined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
"Why I Don't Use Semicolons" http://mattbriggs.net/blog/2012/04/16/why-i-dont-use-semicolons/
"The Infernal Semicolon" https://brendaneich.com/2012/04/the-infernal-semicolon/