Well-Known Symbols: Array item getter/setter

Axel Rauschmayer axel at rauschma.de
Thu Apr 9 20:01:46 UTC 2015

An alternative that was discussed at one point was to invert this idea:

* Arrays get the methods that Maps already have: `get(index)` and `set(index, value)`. Advantage: one could support negative indices. That is, the following two expressions would be equivalent.


* Using brackets for accessing array elements is phased out.

That may be easier to achieve and would fit in well with ES6 collections.

> On 09 Apr 2015, at 21:38, Allen Wirfs-Brock <allen at wirfs-brock.com> wrote:
>> On Apr 9, 2015, at 2:37 PM, Jordan Harband <ljharb at gmail.com <mailto:ljharb at gmail.com>> wrote:
>> One advantage of this approach is that more "spec magic" can be implemented in terms of the language - it would also make subclassed arrays more versatile instead of having to always be a Proxy.
> see http://wiki.ecmascript.org/doku.php?id=strawman:object_model_reformation <http://wiki.ecmascript.org/doku.php?id=strawman:object_model_reformation>
Dr. Axel Rauschmayer
axel at rauschma.de

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150409/1452c2a5/attachment.html>

More information about the es-discuss mailing list