jashkenas/coffee-script — Issue #2044: Feature: functions on params
Author: jasonkuhrt
Created: 2012-01-16 02:18:51+00:00
State: open

Allow functions to be wrapped on params to help reduce noise in a function body. Here is an example use-case:

f = ($($el))->
$el
# do something with jQuery object...

would de-sugar to:

var f;

f = function($el) {
$el = $($el);
return $el;
};