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 String Methods</h1> <p>Display the first array element, after a string split:</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>