Following is my Code:
var i,j;
var period = 5;
var sec = new Array(new Array(new Array()));
for(i=0;i<6;i++){
for(j=1;j<period;j++){
sec[j][i][j] = j;
console.log("SEC: "+j+i+j+" = "+sec[j][i][j]);
console.log('/n');
}
}
When I execute the above code I get cannot read property '0' of undefined at sec[j][i][j] assignment. I don't understand the reason behind it.. It would be great if you guys can help me on this. Thanks in advance.