Function.length and Default Parameters
pmuellr at yahoo.com
Thu Oct 11 08:18:19 PDT 2012
On Wed, Oct 10, 2012 at 1:22 PM, Kevin Smith <khs4473 at gmail.com> wrote:
> We've discussed this extensively before and there doesn't seem to be many
>> plausible use cases for the function length property.
> Here's the only use case that I've encountered (admittedly not
> particularly strong): Overriding the behavior of a function/method based
> on the "signature" of an input function:
express for node already does this, for error handlers:
express is very popular; #4 on Most Depended Upon packages; #1 on Most
Starred at npm:
I will admit a certain amount of dislike for this technique, and
overloading in general; would it really be so hard to provide an
`app.useError()` API instead of 'overloading' `app.use()`?
pmuellr at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss