|
Last change
on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
702 bytes
|
| Rev | Line | |
|---|
| [a762898] | 1 | /**
|
|---|
| 2 | * Gets the index at which the last occurrence of value is found in array.
|
|---|
| 3 | *
|
|---|
| 4 | * @template T
|
|---|
| 5 | * @param {ArrayLike<T> | null | undefined} array - The array to inspect.
|
|---|
| 6 | * @param {T} value - The value to search for.
|
|---|
| 7 | * @param {true | number} [fromIndex] - The index to search from or true to search from the end.
|
|---|
| 8 | * @returns {number} Returns the index of the matched value, else -1.
|
|---|
| 9 | *
|
|---|
| 10 | * @example
|
|---|
| 11 | * lastIndexOf([1, 2, 1, 2], 2);
|
|---|
| 12 | * // => 3
|
|---|
| 13 | *
|
|---|
| 14 | * lastIndexOf([1, 2, 1, 2], 2, 2);
|
|---|
| 15 | * // => 1
|
|---|
| 16 | *
|
|---|
| 17 | * lastIndexOf([1, 2, 1, 2], 2, true);
|
|---|
| 18 | * // => 3
|
|---|
| 19 | */
|
|---|
| 20 | declare function lastIndexOf<T>(array: ArrayLike<T> | null | undefined, searchElement: T, fromIndex?: true | number): number;
|
|---|
| 21 |
|
|---|
| 22 | export { lastIndexOf };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.