I tried to implement a three-dimensional array in JavaScript, but I encountered an error message in Chrome:
Error: Uncaught SyntaxError: Unexpected token [
This is the snippet of my JavaScript code:
function ThreeDimensionalArray(iRows,iCols,iHig)
{
var i;
var j;
var z;
var a = new Array(iRows);
for (i=0; i < iRows; i++)
d {
a[i] = new Array(iCols);
for (j=0; j < iCols; j++)
{
var a[i][j] = new Array(iHig);
for (z=0; z < iHig; z++){
a[i][j][z] = "";
};
};
};
return(a);
};
var hello = ThreeDimensionalArray(3,3,3);