title: xhr response with for loop not working
body: <p>i have xhr with for loop and it work very rare</p>
  
  <pre><code>for(var i = 0; i &lt; this.files.length; i++) {
      var xhr = new XMLHttpRequest();
  
      xhr.upload.onprogress = function(e) {
  
      };
  
      xhr.onreadystatechange = function(e) {
          if(this.readyState === 4) {
              console.log(xhr.responseText);
          }
      };
      var formdata = new FormData();
      formdata.append("files", this.files[i]);
      console.log(this.files[i]);
      xhr.open('POST', 'slike.php');
      xhr.send(formdata);
  }
  </code></pre>
  
  <p>I'm calling this slike.php. And it work very well, but on responseText, it's not good, sometimes get only last file from loop, sometimes get two file(with same text). I don't know how ti fix it, i was looking everywhere, and can't found the answer.</p>