How to search an array element starting from the end of the array Node.js

1 Answer

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

 



answered Feb 10, 2024 by avibootz
...