rest parameters

Tab Atkins Jr. jackalmage at
Fri Oct 2 20:07:49 UTC 2015

On Fri, Oct 2, 2015 at 12:09 PM, Steve Fink <sphink at> wrote:
> I don't know, but I can speculate. It's not at all obvious how ...args in
> the middle should behave: what if you have two rest arguments? Is that
> forbidden, or is one greedy? What if one of the trailing parameters has a
> default value? Also, iiuc the spec treats "undefined" the same as
> "nonexistent" in most places. So what should your function do when passed
> (1, 2, 3, undefined)?
> In short, it seems like a hairball of complexity for no real gain.

Yes, this has been discussed in the past, and issues like what you
brought up are the reason we've rejected it.  There's lots of
ambiguous situations, no clear answer for most (any?) of them, and the
benefit is minimal.


More information about the es-discuss mailing list