Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <body> <h1>includes()</h1> <p>Vérifiez si le tableau de fleurs contient "Marguerite":</p> <p id="demo"></p> <p><strong>Note:</strong> La méthode includes n'est pas prise en charge dans Edge 13 (et les versions antérieures).</p> <script> var fleurs= ["Rose", "Marguerite", "Lis", "Jasmine"]; var n = fleurs.includes("Marguerite"); document.getElementById("demo").innerHTML = n; </script> </body> </html>