Nov 17 meeting notes

Rick Waldron waldron.rick at gmail.com
Fri Nov 18 08:54:16 PST 2011


On Thu, Nov 17, 2011 at 11:06 PM, David Herman <dherman at mozilla.com> wrote:

> On Nov 17, 2011, at 5:20 PM, Rick Waldron wrote:
>
> On Thu, Nov 17, 2011 at 7:40 PM, Waldemar Horwat <waldemar at google.com>wrote:
>
>> Array.from(a) is superfluous because it's expressed even simpler as
>> [... a].  DaveH withdrew it.
>>
>
> Perhaps Array.from() was either misunderstood or miscommunicated. I had
> prepared a complete step-by-step production of the function's semantics and
> documented them here:
>
>
> It turns out that [...arrayLikeThingy] does exactly the same thing; it
> constructs a new Array from the contents of any array-like object.
>

Based on: http://wiki.ecmascript.org/doku.php?id=harmony:rest_parameters...On
first look, I wouldn't guess that [ ...arrayLikeThingy ] behaved that
way, but thanks for the clarification.

Rest params are undoubtedly one of the best new syntax features coming to
ES.next, they compliment and enhance JavaScript's already very expressive
nature. AFAICT, their only drawback is the wait we have until they are a
reality.

To further drive the case for Array.from( arraylike ) I've posted a survey
to Twitter, which I'd like to share the results of here:

https://docs.google.com/spreadsheet/ccc?key=0Ap5RnGLtwI1RdFNCbi13WlllOTk3bDJyb3laNFBneFE

Please read the comments as well.

Thanks

Rick








>
> https://gist.github.com/1074126
>
> These steps support back compat to older JS (and DOM) implementations for
> converting _any_ array looking object (arguments, DOM NodeLists,
> DOMTokenList (classList), typed arrays... etc.) into a new instance of a
> real array.
>
> This is a real problem, in real JavaScript, in the real world. Considering
> the positive response from actual developers in the JS community, I'd like
> to ask that it be reconsidered.
>
>
> The reason why we decided to table the statics was that we had some
> serious questions about inheritance of statics and how they should behave,
> which is part of the ongoing discussions about classes. Given that spread
> (the ... syntax) gives you exactly the behavior you want, and it's actually
> very clear and even more concise than Array.from, it didn't seem worth
> taking more time discussing it now.
>
> Dave
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20111118/ddfefb03/attachment.html>


More information about the es-discuss mailing list