[+] Encapsulate findLastIndex()
This commit is contained in:
@@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
export function findLastIndex<T>(array: T[], callback: (v: T) => boolean): number
|
||||||
|
{
|
||||||
|
let arr2 = array.slice().reverse();
|
||||||
|
return arr2.length - arr2.findIndex(callback);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user