title: Associate Array splice does not work
body: <p>I am trying to understand why in nodejs array splice does not work on an associate array. </p>
  
  <pre><code>var a = [];
  
  a['x1'] = 234234;
  a['x2'] = 565464;
  
  console.log("Init-------");
  showIt();
  
  a.splice(0, 1);
  console.log("After splice-------");
  showIt();
  
  delete a['x1'];
  console.log("After delete-------");
  showIt();
  
  function showIt(){
      var keys = Object.keys(a);
      var len  = keys.length;
      var i=0;
      while (i &lt; len) {
          console.log( '    ' + i +  ' ------------ ' + keys[i] );
          i++;
      }
  }
  </code></pre>
  
  <p>Results:</p>
  
  <pre><code>Init-------
          0 ------------ x1
          1 ------------ x2
  After splice-------
          0 ------------ x1
          1 ------------ x2
  After delete-------
          0 ------------ x2
  </code></pre>
  
  <p>Splicing the array does nothing...  </p>
  
  <p>Same results in a browser... </p>
  
  <h1>Update:</h1>
  
  <p>Splice works as expected when the array is defined as:</p>
  
  <pre><code>var a = ['x1','x2','x3'];
  console.log("Init-------");
  console.log(a);
  
  a.splice('x1', 1);
  console.log("After splice-------");
  console.log(a);
  </code></pre>
  
  <p>Looks like in the first example, the array is being treated as if is was defined as a object <code>{}</code>  in the 2nd, it's being treated more like an array. </p>
  
  <h1>To the Moderators:</h1>
  
  <p>This is not really a question about spare arrays, it is more of a question of an array which is starting at 0 and growing sequentially to 10 million over a period of days. As it is growing the array is being deleted from so that around 1000 items are in the array at one time.</p>
  
  <p>I am considering forcing the use of hash tables by using non-numeric keys or defining as a object <code>{}</code> so that the it acts like a sparse array.  </p>
  
  <p>In the end, I am not sure if it matters...</p>