I have a function which takes any number of arguments and must call two other functions with exactly the same arguments in the same order. I tried like this :
broadcast = (socket, command, args...) ->
socket.emit command, args
socket.broadcast.to('room').emit command, args
This works if args is just an argument but how can I make it work if there are several arguments ?
I’m a bit rusty on coffeescript, but wouldn’t it be
I guess this is something in the lines of what you want? http://github.com/jashkenas/coffee-script/issues/1020