Array.find_last_index

Array.find_last_index

Array.find_last_index

Function

Returns from right to left the index of the first element for which the callback result is true.

Syntax

Parameters

ParametersTypeRequiredDefault valueDescription
callbackFnNoEmptyThe callback signature is fn(value, index, current).

Return value

TypeDescription
IntReturns the subscript if found; returns -1 if not found.

Example

Notes

  • Search from right to left.