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