In a compiled coffee script our code automatically wrapped in a module like below:
(function() {
//Code goes here
}).call(this);
But i want to wrap my code in a module like:
(function($, _) {
//Code goes here
})(jQuery, _);
and
var myModule = (function($, _) {
//Code goes here
})(jQuery, _);
So what i’ve to use for it in coffee Script
You can also use
dofor auto-invoking functions like these:doitself is an expression (that evaluates to the last expression in its body, like any function call), so you can assign its value to a variable: