Version: v0.5.0 - Beta.  We welcome contributors & feedback.  THanks!

List.lastIndex

lastIndex()

Description

Get the index of the last element in a List.

This is essentially list.length() - 1.

If the list is empty, it will return -1;

['a', 'b', 'c'].lastIndex();
//= 2

[].lastIndex();
//= -1

See Also