On Wed, Oct 3, 2012 at 3:36 PM, Brendan Eich <bren...@mozilla.org> wrote:

> Rick Waldron wrote:
>
>> On Wed, Oct 3, 2012 at 2:04 PM, Rick Waldron <waldron.r...@gmail.com<mailto:
>> waldron.r...@gmail.com**>> wrote:
>>
>>
>>
>>     On Wed, Oct 3, 2012 at 1:43 PM, Brandon Benvie
>>     <bran...@brandonbenvie.com 
>> <mailto:brandon@brandonbenvie.**com<bran...@brandonbenvie.com>>>
>> wrote:
>>
>>         Another options for Maps is to represent them as an array of
>>         [key, value].
>>
>>
>>     Which is a rough approximation of what a Map looks like internally.
>>
>>
>>
>> Sorry, this is incorrect. Map looks more like:
>>
>> [key1, key2]
>> [value1, value2]
>>
>> Sorry for confusion
>>
>
> As an implementation in ES5, maybe (O(n) lookup cost). But the thing to
> aim for is the shape of the Map parameter, and that looks like
>
> [[key1, value1], [key2, value2]]
>
> Still need type tagging to revive as a Map, of course.
>
> JSON object notation can't handle Map, though: key can be any value
> (ignore JSON not handling all JS values).



Ugh, sorry, I replied to myself/Dean above before reading ahead.

Rick

>
>
> /be
>
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to