hi!
im trying to translate some code from p5.js
var st = [];
function setup(){
for (var i=0; i<maxW; i++) {
st[i]=[]; // what means this?
bright[i]=[];
}
}
what means ? st is a two dimensional array!
hi!
im trying to translate some code from p5.js
var st = [];
function setup(){
for (var i=0; i<maxW; i++) {
st[i]=[]; // what means this?
bright[i]=[];
}
}
what means ? st is a two dimensional array!
[]
creates an empty new Array.st[i] = [];
creates an empty Array and then assign it to the Array st at its index i.st[maxW][]
.