On Sun, Jul 28, 2013 at 7:38 AM, Axel Rauschmayer <[email protected]> wrote: > Wondering: If most data structures in ES6 use the methods get() and set(), > couldn’t we add those to arrays and then simply allow negative indices? > > Then we’d be able to do the following: >> let arr = [ 'a', 'b', 'c' ]; >> arr.get(-1) > 'c' > > > That’d be kind of like a negative version of Allen’s “Object Model > Reformation” proposal: > http://wiki.ecmascript.org/doku.php?id=strawman:object_model_reformation
I am totally down with this. It also means we can turn Arrays into Map-likes by filling out the rest of the methods. ~TJ _______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

