维科纳蒂 »
×
改变方向
在 Codepen 上打开
更改主题,深色/浅色
<!DOCTYPE html> <html lang='uk'> <body> <h2>JavaScript Array.find()</h2> <p id="demo"></p> <script> const numbers = [4, 9, 16, 25, 29]; let first = numbers.find(myFunction); document.getElementById("demo").innerHTML = "Перше число понад 18 " + first; function myFunction(value, index, array) { return value > 18; } </script> </body> </html>