title: Aborting all ajax requests
body: <p>I've implemented the usual AJAX pool, but when I abort all requests it aborts them at increments of 2 requests, ie. first, third, fifth ...
  This is basically what I do:</p>
  
  <pre class="lang-js prettyprint-override"><code>$.ajaxSetup({
    beforeSend: function(jqXHR, settings) {
      $.xhrPool.push(jqXHR);
    },
    complete: function(jqXHR, text) {
      // Remove a completed request from the array
      var index = $.xhrPool.indexOf(jqXHR);
      if (index &gt; -1) {
        $.xhrPool.splice(index, 1);
      }
    },
    error: function(jqXHR, textStatus, errorThrown) {
      // Remove a error request from the array
      var index = $.xhrPool.indexOf(jqXHR);
      if (index &gt; -1) {
        $.xhrPool.splice(index, 1);
      }
    }
  });
  
  function abortAll() {
    $.each($.xhrPool, function(key, value) {
      value.abort();
    });
  }
  </code></pre>
  
  <p>If I do a <code>console.log(value)</code> inside the <code>$.each</code>, some of them are undefined. If I do a <code>console.log($.xhrPool)</code> before the <code>$.each</code>, they all look ok.</p>
  
  <p>What am I missing?</p>