3 ms·
I understand. If you don't have parens on method calls, how could you use an anonymous function that is not the last parameter? For example: doSomething(->
by MatthewPhillips 15y ago
I understand. If you don't have parens on method calls, how could you use an anonymous function that is not the last parameter? For example:
doSomething(->
# stuff happens
), onerror
- latchkey 15y agoI totally agree with you.
- jacobolus 15y agoFirst, your code snippet is wrong: you need a space before your first paren. In coffeescript you can do any of the following, or a few other variants: doSomething -> stuff , onerror doSomething(-> stuff , onerror ) doSomething (-> stuff ), onerror doSomething( -> stuff onerror ) doSomething (-> stuff), onerror
- Perceptes 15y agoI had this question a while back as well. Take a look at the discussion here, including Jeremy's thoughts: https://gist.github.com/1215863 https://gist.github.com/1215863