On Thu, Aug 10, 2017 at 11:24 PM, Alexander Jones <a...@weej.com> wrote:
>
> As far as I'm concerned, "most data arrays" — at least the ones
> you're speaking about — should actually be `Map`s.

I see the point you're trying to make, but

1. I routinely want paging and other access by arbitrary index

2. I routinely want to change the order, which is expensive with Maps

3. I'm usually receiving these by deserializing JSON

Granted #3 could be solved by making the JSON even more verbose than it is
(`[["foo", {"id":"foo",..}],["bar",{"id": "bar", ...],...]`) and then
creating the Map from that temporary array of arays but...no. :-) Not least
because of the knock-on effects on the generating code. So I'd need a way
to create the Map from the array even if I *were* using Maps from then on
(such as my `Map.from`).

Arrays are great random-access, sortable, tranferrable format; and
highly-optimized on modern JavaScript engines. No need to change it. And if
I *did* change it, I'd still need a way to create the Map in the first
place from the obvious transfer format: An array.

-- T.J. Crowder
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to