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

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

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

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

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

es-discuss mailing list
[hidden email]