Proposal-index-from-end array[^n]

Cyril Auburtin cyril.auburtin at gmail.com
Wed Aug 21 18:34:45 UTC 2019


There has been many "array.last()" and similar proposals on es-discuss

One has emerged: https://github.com/keithamus/proposal-array-last
It adds Array.prototype.lastIndex and Array.prototype.lastItem

I'd like to extend this idea with a syntax like `arr[^n]` (stands for
`arr[arr.length - n]`), I wrote it in
https://github.com/keithamus/proposal-array-last/issues/28

The idea comes from @rbuckton
https://github.com/tc39/proposal-slice-notation/issues/30
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20190821/17c3dc83/attachment.html>


More information about the es-discuss mailing list