Hi,
i try to generate a 2 dimensional arrya (10 rows, 20 columns) and initialize them with data within nested for loops.
My problem is: i cannot find the correct syntax to get it working. www.w3schools.com has no example for those arrays. The only thing i found is var person = [];
So i tried:
var state = [[],[]];
for (device = 1;device < 11;device++) {
for (index = 0; index < 20; index++) {
state[device][index] = 0;
}
}
flow.set("state",state);
but i get "TypeError: Cannot set property '0' of undefined"
Would be happy if anyone has a good hint for me!