Float32Array.prototype.lastIndexOf

Returns the index of the last occurrence of a specified value in a typed array, or -1 if it is not present.

Syntax

lastIndexOf(value, fromIndex?)

Parameters

Return value

An index or -1 if the element was not found.

Example

new Float32Array([1, 2, 42, 42, 108]).lastIndexOf(42)
3
// compare to indexOf:
new Float32Array([1, 2, 42, 42, 108]).indexOf(42)
2

See also