I have a reduce function like this:
ops = rqOps.reduce (p, { commit: id: cid, type: type }, idx, arr) ->
# Do stuff here
p
, {}
which works fine, but now the name of the second argument compiles to _arg
. How can I give it a different name? I've tried several different approaches like arg = { commit: id: cid, type: type }
and { commit: id: cid, type: type } : arg
and { commit: id: cid, type: type } = arg
but nothing compiles to the intended result. What's wrong with my syntax?