How to search an array element starting from the end of the array TypeScript

1 Answer

0 votes
const arr: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 144];
 
const result: number = arr.findLast(i => i > 7)
 
console.log(result);
    
        
        
/*
run:
        
144
        
*/

 



answered Feb 10, 2024 by avibootz
...