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>
There has been many "array.last()" and similar proposals on es-discuss
One has emerged: 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 forarr[arr.length - n]
), I wrote it in keithamus/proposal-array-last#28The idea comes from @rbuckton tc39/proposal-slice-notation#30