title: Javascript array contains only undefined after initialization, not the given values
body: <p>I thought I knew how to declare javascript arrays but in this script I am getting an infinite loop of <code>undefined</code> elements in the array.</p>
  
  <p>I declare three arrays of numbers, two of which have multiple values and one which has a single value.</p>
  
  <p>I have a switch statement that assigns one of the three arrays to a new variable name <code>cluster_array</code></p>
  
  <p>When I run a <code>for</code> loop through <code>cluster_array</code>, I get an infinite loop and every element if <code>undefined</code></p>
  
  <p>What am I missing?</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      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);
  
  // original bad array
      var ga_east_cluster = new Array(84);
  // added an extra (dummy) value and it works fine   
      var ga_east_cluster = new Array(1,84);
      var sc_cluster      = new Array(93,94,95,96,97,98,99,100,101,102,103);
  &lt;/script&gt;
  </code></pre>
  
  <p>Here is the <code>alert</code> text:</p>
  
  <pre><code>var test_message        = "cluster data\n";
      for(var k=0;k&lt;cluster_array.length;k++)
          test_message    += "value: "+cluster_array[k]+"\n";
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/MYKUf.png" alt="test alert box"></p>