
Please critique this CoffeeScript code. Is it idiomatic?
MoneyAccount = (balance = 0) ->
obj = {
withdraw: (x) ->
if balance < x
throw new Error("not enough funds in account")
else
balance -= x
console.log "withdrew funds."
x
deposit: (x) ->
...