title: How to remove all undefined keys from a javascript array (hopefully when creating the array?)
body: <p>I have placed my frustrations into a jsfiddle to observe here: <a href="http://jsfiddle.net/8ShFr/1/" rel="nofollow">http://jsfiddle.net/8ShFr/1/</a></p>
  
  <pre><code>var brand_new_array = new Array();
  brand_new_array[10] = "random array value";
  alert('why does this array have a length of ' + brand_new_array.length + '???');
  </code></pre>
  
  <p>I am doing some calculations client side that require me to set javascript array keys of 1M+ in number.</p>
  
  <p>Not knowing exactly what that number is demands that I iterate through the first 1M+ empty array values before getting to an array key that holds data.</p>
  
  <p>I simply want to set a single large key value for a javascript array without creating a bunch of empty keys before it?</p>
  
  <p>I am using jQuery.each to iterate over the array, and it keeps going through <code>array[0]</code>, <code>array[1]</code>, <code>array[2]</code>, etc... when I only set <code>array[123125]</code> for example.</p>