title: Why doesn't the delete operator change the length of an array?
body: <p>As an example, when using the <code>delete</code> operator on an index of an Array, the index is removed, such as any property of any object would be.</p>
  
  <p>This is proven by:</p>
  
  <pre><code>var arr = ['one', 'two', 'three'];
  
  delete arr[1];
  
  if(1 in arr)
      alert("It didn't work!");
  </code></pre>
  
  <p>If you were to run this block, you will find that the text "It didn't work!" will never be alerted to the user. This is because the property belonging as index <code>1</code> on the Array has been deleted.</p>
  
  <p>Now, here is where things get weird...</p>
  
  <p>Although an index is deleted from an Array, the Array length shall remain the same:</p>
  
  <pre><code>var arr = ['one', 'two', 'three'];
  
  alert(arr.length); //will alert '3'
  
  delete arr[2];
  
  alert(arr.length); //will still alert '3'
  </code></pre>
  
  <p>When looking at the Array <code>arr</code> in the debugger (in Chrome at least), you will see that the index <code>2</code> does not even exist, <strong>so why does the length still report as 3?</strong></p>
  
  <p><a href="https://jsfiddle.net/WebWanderer/8140uj75/" rel="nofollow">Here is a JSFiddle to play around with.</a></p>