Function.length and Default Parameters

Kevin Smith khs4473 at gmail.com
Thu Oct 11 20:25:48 PDT 2012


> And specifically not stopping counting at the first parameter with a
> default value, right?


Yep.  Would it also work for this use case to stop counting at the first
parameter with no default value, after which there are only defaults?

    function f(a, b = 2, c, d = 4, ...rest) {}
    f.length === 3;

Probably? Not sure...

Kevin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121011/f8435e75/attachment.html>


More information about the es-discuss mailing list