In Coffeescript, what's the best way to create a function with mandatory parameters? At the moment, I'm doing this:
myFunction: (requiredParam, optionalParam) ->
unless requiredParam? then throw new Error ...
...
If I have, say, 5 parameters or even more, it takes quite a lot of time and space to throw an error for each parameter.
Is there a simpler/more concise way of doing this?