[][src]Function boa::builtins::array::last_index_of

pub fn last_index_of(
    this: &Value,
    args: &[Value],
    _: &mut Interpreter
) -> ResultValue

Array.prototype.lastIndexOf ( searchElement[, fromIndex ] )

lastIndexOf compares searchElement to the elements of the array in descending order using the Strict Equality Comparison algorithm, and if found at one or more indices, returns the largest such index; otherwise, -1 is returned.

The optional second argument fromIndex defaults to the array's length minus one (i.e. the whole array is searched). If it is greater than or equal to the length of the array, the whole array will be searched. If it is negative, it is used as the offset from the end of the array to compute fromIndex. If the computed index is less than 0, -1 is returned. https://tc39.es/ecma262/#sec-array.prototype.lastindexof