how to display an array in html
<p id="display-array"></p>
<script type="text/javascript">
// array to be displayed
var array = [1, 2, 3, 4, 5];
// access the textContent of the HTML element and set it to the
// value of the array seperated with a comma and a space
document.getElementById("display-array").textContent = array.join(", ");
</script>