The array-like object to search.
The value to locate in the array. Values are
compared using strict ===
equality.
The index of the first element in the range to be
searched, inclusive. The default value is -1
. Negative values
are taken as an offset from the end of the array.
The index of the last element in the range to be
searched, inclusive. The default value is 0
. Negative values
are taken as an offset from the end of the array.
The index of the last occurrence of the value, or -1
if the value is not found.
If start < stop
the search will wrap at the front of the array.
Linear.
A start
or stop
which is non-integral.
import { ArrayExt } from '@lumino/algorithm';
let data = ['one', 'two', 'three', 'four', 'one'];
ArrayExt.lastIndexOf(data, 'red'); // -1
ArrayExt.lastIndexOf(data, 'one'); // 4
ArrayExt.lastIndexOf(data, 'one', 1); // 0
ArrayExt.lastIndexOf(data, 'two', 0); // -1
ArrayExt.lastIndexOf(data, 'two', 0, 1); // 1
Generated using TypeDoc
Find the index of the last occurrence of a value in an array.