Pure win: Array.from and Array.of

Dmitry A. Soshnikov dmitry.soshnikov at gmail.com
Mon Jul 11 12:49:05 PDT 2011


On 11.07.2011 20:01, Allen Wirfs-Brock wrote:
> On Jul 10, 2011, at 12:09 PM, Dmitry A. Soshnikov wrote:
>
>> And by the way, an efficient `Array.prototype.unique` also would be nice to have, since in JS in general it's hard to implement it's efficiently (in lower level at least it will iterate faster).
>>
>> [1, 3, 2, 5, 5, 3].unique(); // [1, 3, 2, 5]
> Before considering adding too many things to Array.prototype

I wouldn't call such standard methods which are present in standard 
libraries of many languages as "too many things".

>   we perhaps should start considering the protocol of a real collection hierarchy that goes beyond just arrays.
>

Yes, and this is of course true.

Dmitry.


More information about the es-discuss mailing list