My attempt to populate "array1" with numbers from 1 to 10 seems to be failing.
array1 = ["123", "abc", "string", "text", "test", "ok"]
while (i <= 10){
array1.push(i)
i++
}
document.getElementById("p0").innerHTML = document.getElementById("p0").innerHTML + " | " + array[Math.floor((Math.random() * array.length))]
No matter what, the innerHTML of p0 remains as "Random Array Item:" and doesn't change. However, if I remove the while loop, it works fine, displaying output like this: "Random Array Item: | test | text | abc | abc | text | abc"