export async function lastIndexOf < TElement > ( source , predicate ) { let [ result , index ] = [ - 1 , - 1 ] ; for await ( const element of source ) { if ( predicate ( element , ++ index ) ) { result = index ; } } return result ; }