W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<!DOCTYPE html> <html> <body> <h1>Array includes()</h1> <p>检查 fruit 数组是否包含 "Mango":</p> <p id="demo"></p> <p><b>注释:</b>Edge 13(及更早版本)不支持 includes 方法。</p> <script> const fruits = ["Banana", "Orange", "Apple", "Mango"]; document.getElementById("demo").innerHTML = fruits.includes("Mango"); </script> </body> </html>