Created
April 3, 2012 18:07
-
-
Save sankage/2294271 to your computer and use it in GitHub Desktop.
CoffeeScript: self executing anonymous 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
# Is there a coffeescript way of doing this? | |
(function($, exports){ | |
# doing random stuff here | |
})(jQuery, window); | |
# Other than this: | |
( ($, exports) -> | |
# doing random stuff here | |
)(jQuery, window) | |
# no syntactic sugar, but you can do: | |
do ($ = jQuery, exports = window) -> | |
# doing random stuff here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ah, but what do
$
andexports
represent? They are missing the other half of their aliases.