Nov 17 meeting notes
dherman at mozilla.com
Thu Nov 17 20:06:55 PST 2011
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.
> 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.
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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss