I have arrays within objects full of false values.
var drumOn = {}, bassOn = {}, synthOn = {}, keysOn = {};
var fal = [];
for(var j=0; j<16; j++){
fal.push(false);
}
for(var j=0; j<0; j++){
drumOn['s'+j] = (fal);
bassOn['s'+j] = (fal);
synthOn['s'+j] = (fal);
keysOn['s'+j] = (fal);
}
then later I try adding one true value to one array
drumOn['s'+ 0][0] = true;
This adds a true value to the first element of all the arrays within drumOn and within the other objects too.
The only other thing I'm doing with these objects is checking
if(bassOn['s' + i][j])
I was doing this with arrays within arrays and I had the same problem.
This is crazy, I've tried so many things but it makes no sense.
falarray. So, when you edit one, they all get edited.drumOn['s' + j]will access the propertydrumOn.s0.