Processing concurrent AJAX requests
Does using promise.all suffice to promote concurrency?


It's not really Promise.all that does it. You're starting your requests without waiting for the previous ones to complete, so yes, they run concurrently. All Promise.all does is let you know when all of the promises you give it have resolved (or when the first one rejects).


  can someone suggest any improvements?


Some thoughts:


In getInfoViaConcurrency:


Your use of map is incorrect, kind of a mash-up of your original forEach (from your now-deleted post on SO) and map
You can pass getInfoViaAjax directly to map
The then handler on the Promise.all serves no purpose and can be removed

In getInfoViaAjax, you could use fetch on modern browsers rather than XMLHttpRequest


So getInfoViaConcurrency could be:

function getInfoViaConcurrency(ids) {
  return Promise.all(ids.map(getInfoViaAjax));
}


and if you want to use fetch, getInfoViaAjax could be:

function getInfoViaAjax(id) {
  return fetch({/*...appropriate options and URL...*/}).then(response =&gt; {
      if (!response.ok) {
          throw new Error(/*...whatever you want to say here...*/);
      }
      return response.text();
  });
}