title: should i use `delete array[x]; array.length-=1` instead of `array.splice(x,1)`?
body: <p>I want to remove an item from an array, is <code>array.splice(x,1)</code> the best way to go?</p>
  
  <p>Is <code>array.splice(x,1)</code> functionally equivalent to <code>delete array[x]; array.length-=1</code> ?</p>
  
  <p>I've read these threads: <a href="https://stackoverflow.com/questions/495764/javascript-object-with-array-deleting-does-it-actually-remove-the-item">Javascript object with array, deleting does it actually remove the item?</a> and <a href="https://stackoverflow.com/questions/500606/javascript-array-delete-elements">Deleting array elements in JavaScript - delete vs splice</a></p>
  
  <p>and did some tests:</p>
  
  <pre><code>&lt;script&gt;
  var arr=[];
  for(var x=0;x&lt;100000;++x){
      arr.push(x);
  }
  var a=new Date().getTime();
  for(var x=0;x&lt;50000;++x){
      arr.splice(49999,1);
  }
  var b=new Date().getTime();
  alert(b-a);
  &lt;/script&gt;
  
  &lt;script&gt;
  var arr=[];
  for(var x=0;x&lt;100000;++x){
      arr.push(x);
  }
  var a=new Date().getTime();
  for(var x=0;x&lt;50000;++x){
      delete arr[49999];
      arr.length-=1;
  }
  var b=new Date().getTime();
  alert(b-a);
  &lt;/script&gt;
  </code></pre>
  
  <p>The timing difference is over a magnitude of 100, making the itch to use the second solution almost irresistable.. but before using it, I would like to ask this question: are there any traps i should look out for when i use <code>delete array[x]; array.length-=1</code> instead of <code>array.splice(x,1)</code>?</p>