x
 
<!DOCTYPE html>
<html>
<body>
<h1>JavaScript 数组</h1>
<h2>findLastIndex() 方法</h2>
<p id="demo"></p>
<script>
const temp = [27, 28, 30, 40, 42, 35, 30];
let pos = temp.findLastIndex(x => x > 40);
document.getElementById("demo").innerHTML = "最后一个超过 40 度的温度位于位置 " + pos;
</script>
</body>
</html>