On Sat, Jan 23, 2016 at 12:46 PM, kdex <[email protected]> wrote:
> @Michał: That really depends on the point of view: If you need zero-based
> indexing from the right, as `[]` does from the left, you'd use
> `Array.prototype.last`.
>
> On Samstag, 23. Januar 2016 20:56:02 CET Michał Wadas wrote:
>> I can't consider `.last(1)` method to be readable...
>> But I think `.nth(n)` method with support for negative index would be
>> really useful.
>>

you can also slice from the end of an array:

var a = [1,2,3,4];
// Get the second-to-last item.
a.slice(-2,-1)

A method to find an item at a given index could be designed.

a.itemAt(-2);

I trimmed the rest. I have enough difficulty with advanced GMail view.
I can't get back to Basic HTML view as default. Top posting makes
editing a lot harder in GMail Advance View. Plus it auto-saves on
every undo/redo, and coupling that with El Capitan, and it's all so
slow and clunky.

So I didn't fix yuour top post completely. Because I'm saving my
energy up for figuring out how to paste into youtube comments. Man,
this web stuff, google… so cutting edge. Wow!

-- 
Garrett
@xkit
ChordCycles.wordpress.com
garretts.github.io
personx.tumblr.com
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to