Spread and non objects

Jon Zeppieri jaz at bu.edu
Thu Nov 4 19:59:48 PDT 2010


On Thu, Nov 4, 2010 at 10:48 PM, Jon Zeppieri <jaz at bu.edu> wrote:

>
>
> Spread-as-rest-arg-syntax constructs an array. Spread-as-operator splices
> the elements of an array into an argument list.
>
> So, if a spread operator expression: ...null splices zero values into an
> argument list, then its counterpart would be something like:
>
> function foo(x, y, ...z) { }
>
> foo(1, 2);
>
> ... where we pass zero optional arguments to foo, and z is bound to an
> empty array. Which is what we'd expect. So, yeah, plan B makes sense.
>
>
Ugh. Sorry for working out my confusion in posts to this list. Of course,
the example above isn't a satisfactory counterpart to the ...null
expression, since it doesn't anywhere involve a null. I suppose there is no
real counterpart in the rest arg syntax.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20101104/bbbdd820/attachment.html>


More information about the es-discuss mailing list