Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 12 lines (9 sloc) 248 Bytes
export function lastIndexOf<T>(array: T[], searchedValue: T): number {
for (let index = array.length - 1; index > -1; index -= 1) {
const value = array[index];
if (value === searchedValue) {
return index;
}
}
return -1;
}
You can’t perform that action at this time.