Menu
Hi,
I am trying to initialize all the values of an array to 0. This is how I did it:
var clicked = new Array(6);
function begin()
{
var i = 0;
while(i < clicked.length)
{
clicked[i] = 0;
++i;
}
}
Is there something wrong with this? For some reason the statements within the loop will only execute once and then no code after that will execute. And I’m not even sure if the clicked[0] has been assigned the value because when I try to display it with a document.writeln() nothing happens.
I know this is supposed to be really simple, but any advice would be greatly appreciated.
Thanks