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.

    ```js
    arr.get(-1)
    arr.get(arr.length-1)
    ```

* 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 <[email protected]> wrote:
> 
> 
>> On Apr 9, 2015, at 2:37 PM, Jordan Harband <[email protected] 
>> <mailto:[email protected]>> 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
[email protected]
rauschma.de



_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to