3 ms·
My solution above (naming functions) is one solution to the problem. Wrapping ambiguous objects or arrays is another: f 1, 2, { foo: "bla" bar
by mratzloff 14y ago
My solution above (naming functions) is one solution to the problem.
Wrapping ambiguous objects or arrays is another:
f 1, 2, {
foo: "bla"
bar: "bla"
}, (error, result) ->
# do something with result
For a series of function parameters, the leading comma is another:
f.asyncMap (item) ->
foo item
, (error, result) ->
# do something with result
- arnarbi 14y agof.asyncMap (item) -> foo item , (error, result) -> # do something with result The readability of that is terrible. I (and most people) can easily figure out how to make myself understood to the parser, that's not an issue at all. The itch that CS scratches is severe, but I believe there is an opportunity to have something much better in terms of readability and predictability.
- mratzloff 14y agoWhich is why it was the third alternative, and not the first. :-)