Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <body> <h1>JavaScript Arrays</h1> <h2>The findLastIndex() Method</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 = "The last temperature over 40 was in position " + pos; </script> </body> </html>