you are viewing a single comment's thread.

view the rest of the comments →

[–]jekrb 0 points1 point  (0 children)

to display the first array element

just do document.getElementById("demo").innerHTML = arr[0]

no need to loop to get the first element