Exécuter
❯
Exécuter le code
Ctrl+Alt+R
Enregistrer le code
Ctrl+Alt+A
Changer d'orientation
Ctrl+Alt+O
Changer de thème
Ctrl+Alt+D
<!DOCTYPE html> <html> <body> <h1>Méthodes de chaîne JavaScript</h1> <p>Affichez le premier élément du tableau, après une séparation de chaîne :</p> <p id="demo"></p> <script> let text = "a,b,c,d,e,f"; const myArray = text.split(","); document.getElementById("demo").innerHTML = myArray[0]; </script> </body> </html>