Created
November 20, 2012 21:22
-
-
Save hshoff/4121244 to your computer and use it in GitHub Desktop.
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
// crockford problem | |
(function(){console.log('module1');}())(function(){console.log('module2');}()); | |
// => module1 | |
// => module2 | |
// => TypeError: undefined is not a function | |
// it invokes module1 | |
(function(){ console.log('module1'); }()) | |
// => module1 | |
//it invokes module2 | |
(function(){ console.log('module2'); }()); | |
// => module2 | |
// equivalent | |
(undefined(undefined)) | |
// => TypeError: undefined is not a function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment