I've found a kind of estrange effect while I was using several related arrays. After break my mind looking for the error, finally I've found a solution. But I would like to know if any of you can explain me why is happening this.
My code was something like:
var closed =['closed', 'closed', ..., 'closed'];
sunday = closed;
...
saturday = closed;
After this if i do:
sunday[2] = 'open';
I get sunday[2] = 'open', monday[2] = 'open', tuesday[2] = 'open', ..., saturday[2] = 'open'. It's like all the variables were been 'glued' or linked because no mater which you change, all of them change in the same way.
I've fixed it in this way:
var closed1 =['closed', 'closed', ..., 'closed'];
...
var closed7 =['closed', 'closed', ..., 'closed'];
sunday = closed1;
...
saturday = closed7;
And now I get independent variables. But I don't like this solution, so I'd be grateful if someone knows the problem. I'm running JavaScript over Google Chrome.
Thanks