JavaScript Language feature Idea

Bruno Jouhier bjouhier at
Tue Apr 19 05:17:06 UTC 2016

Why new syntax here? This is just a method that's missing: `array.last(n)`.

`array[-1]` would break things and it is difficult to find out where.

``` javascript
for (var i = array.length - 1; array[i]; i--) doSomething(array[i]);

Not the best way to write such a loop but changing `array[-1]` would break
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list