3 ms·
I haven't used CS as much as yourself, but I don't find anything pretty in "element = =>".
by viseztrance 14y ago
I haven't used CS as much as yourself, but I don't find anything pretty in "element = =>".
- alecperkins 14y agoIf you use anonymous functions a lot, it's amazing: result = _.map object, (val, key) -> foo(val) is much cleaner than var result = _.map(object, function(val, key) { return foo(val) }); I think.
- deanotron 14y agoThat is a good example, and something that is eased by syntax highlighting (although I rarely implement double-bar function literals, keeping a pythonic 'self = this' reference is preferrable in most cases) Although it is all subjective aesthetics, CS shines when paired with underscore.js, and really all "callback-as-last-argument" paradigms, ie: _.each items, (item) -> # do stuff with item # ... (edited formatting, also what alec said below :)