qwertyzw qwertyzw - 8 months ago 64
CoffeeScript Question

Coffeescript's Q.defer() then's call back

I've seen

defereed.then (arg) =>
function body


deferred.then (
(arg) =>
function body

Can someone explain the difference?

This is from https://github.com/gwomacks/php-debug/blob/master/lib/engines/dbgp/dbgp-instance.coffee


There is no difference. Parenthesis are optional in Coffeescript:

You don't need to use parentheses to invoke a function if you're passing arguments. The implicit call wraps forward to the end of the line or block expression.

console.log sys.inspect object → console.log(sys.inspect(object));