Double Array – Show All Items

[Total: 0    Average: 0/5]

This shows how to have a 2 dimensional array that dumps all its values to the screen on the document load.

Body Code:

<script type=text/javascript>
var _a = new Array("a-one","a-two","a-three","a-four");
var _b = new Array("b-one","b-two","b-three");
var _c = new Array("c-one","c-two","c-three","c-four","c-five");
var A = new Array(_a,_b,_c);

for (i in A) {
  for (j in A[i]) {
    document.write(A[i][j]+"<BR>");
  }
}
</script>

Times Viewed: 0

Leave a Reply

Your email address will not be published. Required fields are marked *