While I like CoffeeScript, I feel I need to note that this isn't really a great example - in fact, I'd call it an incorrect example:<p><pre><code> var elem, formValues;
formValues = (function() {
var _i, _len, _ref, _results;
_ref = $('.input');
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
elem = _ref[_i];
_results.push(elem.value);
}
return _results;
})();
</code></pre>
That's... needlessly <i>bad</i>, so to speak. That could be rewritten in a much more readable fashion, like so:<p><pre><code> var formValues = (function(inputEls) {
var results = [];
inputEls.each(function() {
results.push($(this).val());
});
return results;
})($('.input'));
</code></pre>
If CoffeeScript is generating the first block seen here, then I'd actually be concerned, but perhaps I care more about this than some. Either way, while...<p><pre><code> formValues = (elem.value for elem in $('.input'))
</code></pre>
...is certainly nicer, I don't really think it's necessary to further bastardize the views held on Javascript syntax in general. The first block in this comment is, to put it bluntly, <i>utter shit</i>, and does nothing but continue the trend that "oh god Javascript is horrible".