Created
July 26, 2011 02:54
-
-
Save irace/1105846 to your computer and use it in GitHub Desktop.
Chaining numerous invocations of the same anonymous JavaScript function
This file contains hidden or 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
| // Please let me know if one approach is better than the other | |
| (function(arg) { | |
| alert(arg); | |
| return arguments.callee; | |
| }('foo')('bar')('baz')); | |
| (function f(arg) { | |
| alert(arg); | |
| return f; | |
| }('foo')('bar')('baz')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment