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>Tableaux JavaScript</h1> <h2>La méthode from()</h2> <p>La méthode from() peut renvoyer un tableau à partir de n'importe quelle variable ayant une propriété length.</p> <p>Il peut renvoyer une chaîne sous forme de tableau :</p> <p id="demo"></p> <script> let text = "ABCDEFG"; const myArr = Array.from(text); document.getElementById("demo").innerHTML = myArr; </script> </body> </html>