I am trying to populate a dynamic 3 dimensional array so I don't have to type it all out
var o = {
matrix: (function(n) {
for (var x = 0; x < n; x ++) {
for (var y = 0; y < n; y++) {
for (var z = 0; z < n; z++) {
this[x][y][z] = -1;
}
}
}
}).call(Array, 5),
...
}
The message I get is Uncaught TypeError: Cannot read property '0' of undefined
Any help ... please? :(