Map.prototype.clear method

Yehuda Katz wycats at gmail.com
Mon Oct 22 12:07:04 PDT 2012


On Mon, Oct 22, 2012 at 11:32 AM, Domenic Denicola <
domenic at domenicdenicola.com> wrote:

>  On Oct 22, 2012, at 14:28, "Yehuda Katz" <wycats at gmail.com> wrote:
>
>  On Mon, Oct 22, 2012 at 11:11 AM, Axel Rauschmayer <axel at rauschma.de>wrote:
>
>>   What about copying of these new data structures?
>>
>>
>>  It should be possible to initialize a collection via another collection
>> (right?). I prefer copy-constructors to clone() methods.
>>
>
>  That would be fine with me, if supported.
>
>
>
>  Isn't it already specced to work, for Set at least, since it accepts any
> iterable?
>
>  let copy = new Set(original);
>
>  I don't recall offhand if Map accepts an iterable of [key, val] pairs,
> but if it doesn't yet, maybe this provides an argument that it should.
>

Sounds good. Hopefully VMs can optimize the implementation when a Map/Set
is passed in.


-- 
Yehuda Katz
(ph) 718.877.1325
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121022/7821974b/attachment.html>


More information about the es-discuss mailing list