0

How to find the index of the first element in the array that satisfies the provided testing function in JavaScript

JavaScript
const array1 = [5, 12, 8, 130, 44];

const isLargeNumber = (element) => element > 13;

console.log(array1.findIndex(isLargeNumber)); // 3
RUN
add comment
Suggest a different solution or add another example