[F] Fix not found problem

This commit is contained in:
Hykilpikonna
2019-12-07 14:05:09 -05:00
parent fe3d96ec9c
commit 2d119ce531
+2 -2
View File
@@ -2,6 +2,6 @@
export function findLastIndex<T>(array: T[], callback: (v: T) => boolean): number
{
let arr2 = array.slice().reverse();
let result = arr2.length - arr2.findIndex(callback);
return result == -1 ? -1 : result - 1;
let result = arr2.findIndex(callback);
return result == -1 ? -1 : arr2.length - result - 1;
}