findIndex() 方法返回数组中满足提供的测试函数的第一个元素的索引。若没有找到对应元素则返回-1。

const array = [5, 12, 8, 130, 44];
array.findIndex((element) => element > 13); // 3