you're using var the second time which declares it as a local
variable. So it limits the scope of myArray's use - e.g. perhaps
inside a function. Perhaps that's the problem. If it is just make
sure you declare it in the scope that it will be used from.