@newdash/newdash
Version:
javascript/typescript utility library
24 lines (23 loc) • 623 B
TypeScript
/**
* This method is like `indexOf` except that it iterates over elements of
* `array` from right to left.
*
* @since 5.6.0
* @category Array
* @param array The array to inspect.
* @param value The value to search for.
* @param fromIndex The index to search from.
* @returns Returns the index of the matched value, else `-1`.
* @example
*
* ```js
* lastIndexOf([1, 2, 1, 2], 2)
* // => 3
*
* // Search from the `fromIndex`.
* lastIndexOf([1, 2, 1, 2], 2, 2)
* // => 1
* ```
*/
export declare function lastIndexOf<T>(array: ArrayLike<T>, value: T, fromIndex: number): number;
export default lastIndexOf;