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 On Jul 28, 2013, at 14:13 , David Bruant <[email protected]> wrote: > Hi, > > Asked by Angus Croll [1]. Interestingly, people who answered giving code > didn't agree on a method or getter. Hence the need for a standard :-) > Array.prototype.first could work too. > > David > > [1] https://twitter.com/angustweets/status/359827047117373443 > _______________________________________________ > es-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es-discuss > -- Dr. Axel Rauschmayer [email protected] home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

