While bare compiling CoffeScript to better understand it, I started wondering how I can write the wrapper function
(function(){
}).call(this)
using CoffeScript.
I know I could just compile it the way it is supposed to, but I'm curious.
While bare compiling CoffeScript to better understand it, I started wondering how I can write the wrapper function
(function(){
}).call(this)
using CoffeScript.
I know I could just compile it the way it is supposed to, but I'm curious.
Compiling:
console.log('Try');
in CoffeeScript 1.6.3 gives:
// Generated by CoffeeScript 1.6.3
(function() {
console.log('Try');
}).call(this);
Try here: http://www.compileonline.com/try_coffeescript_online.php
or if you'd rather have the bare one, compile:
#blank
gives:
// Generated by CoffeeScript 1.6.3
(function() {
}).call(this);
In case the --bare option is turned on, you can use:
( -> ) .call(this)
which gives:
(function() {}).call(this);
Try it here: http://coffeescript.org/ (Try coffee tab.)