I thought I knew how to declare javascript arrays, but in this script I get an infinite loop of undefined elements in the array.
I declare three arrays of numbers, two of which have multiple values ββand one value that has one value.
I have a switch statement that assigns one of the three arrays a new variable name cluster_array
When I run the for loop through cluster_array , I get an infinite loop and every element if undefined
What am I missing?
<script type="text/javascript"> var ga_west_cluster = new Array(10,11,12,14,74,75,76,77,78,79,80,81,82,83,85,86,87,88,89,90,91,92,295,296); </script>
Here is the alert text:
var test_message = "cluster data\n"; for(var k=0;k<cluster_array.length;k++) test_message += "value: "+cluster_array[k]+"\n";

javascript arrays undefined
Patrick
source share