title: foreach only sends last xhr request
body: <p>I have a textarea where users can enter multiple URLs which in return will be used for an API request.</p>
  
  <p>The issue I run into is that only the last URLs API request gets captured (sometimes multiple times).</p>
  
  <pre><code>$('.start').on('click',function()
  {
      var url_list = $("#url-list").val();
      var urls = url_list.split("\n");
  
      for (var i = 0, len = urls.length; i &lt; len; i++) {
          console.log("i is "+i)
          var xhr = new XMLHttpRequest();
          xhr.open('GET', urls[i], true);
          xhr.send();
  
          xhr.onreadystatechange = processRequest;
  
          // send API request
          function processRequest() {
              if (xhr.readyState == 4 &amp;&amp; xhr.status == 200) {
                  var response = JSON.parse(xhr.responseText);
                  console.log(response);
              }
          }
      }
  });
  </code></pre>
  
  <p>I don't see exactly where I am doing something wrong, I might be blind to it or just don't know any better. Any help would be appreciated. PS. fairly new to making API requests.</p>