Multi-dimension arrays are arrays where each element is itself an array.
Code:
<script type="text/javascript"> //<![CDATA[
var floss = new Array(); floss[0] = 12; floss[1] = 4.99; floss[2] = 345; var toothbrush = new Array(); toothbrush[0] = 203; toothbrush[1] = 2.77; toothbrush[2] = 2416; var toothpaste = new Array(); toothpaste[0] = 89; toothpaste[1] = 1.43; toothpaste[2] = 968; var items = new Array(); items[0] = floss; items[1] = new Array(); items[1] = toothbrush; items[2] = new Array(); items[2] = toothpaste; for (i=0; i<items.length; i++) { for (j=0; j<3; j++) { document.write("items[", i, "][", j, "] : ", items[i][j], "<br>"); } document.write("<br>"); } //]]> </script>
Output: