Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CoffeeScript creating a wrapper function with passed arguments

How can I generate this output with CoffeScript?

(function(doc) {})(document);
like image 669
Aleksandr Makov Avatar asked Dec 07 '22 16:12

Aleksandr Makov


1 Answers

Not exactly what you have asked, but the spirit of the code is the same and it is more coffeescriptish :

do (document) ->
   # whatever

which compiles to

(function(document) {})(document);
like image 184
Adrien Avatar answered Jan 05 '23 16:01

Adrien