lastIndexOf method
Returns the last index of value
in this list.
Searches the list backwards from index start
to 0.
If start
is not provided, this method searches from the end of the list.
The first time an object o
is encountered so that o == value
, the
index of o
is returned.
final notes = ImmortalList(['do', 're', 'mi', 're']);
notes.lastIndexOf('re'); // 3
notes.lastIndexOf('re', 2); // 1
Returns -1 if value
is not found.
notes.lastIndexOf('fa'); // -1
Implementation
int lastIndexOf(T value, [int? start]) => _list.lastIndexOf(value, start);