Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <body> <h1>JavaScript Iterables</h1> <h2>Iterate over a String</h2> <p id="demo"></p> <script> // Create a String const name = "W3Schools"; // List all Elements let text = "" for (const x of name) { text += x + "<br>"; } document.getElementById("demo").innerHTML = text; </script> </body> </html>