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>Access an Array by Index</h1> <p id="demo"></p> <script> const myJSON = '["Ford", "BMW", "Fiat"]'; const myArray = JSON.parse(myJSON); document.getElementById("demo").innerHTML = myArray[0]; </script> </body> </html>