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
http://jsperf.com/not-function