JSFiddle - React, Tailwind, and code Playground

HTML

Look in the console.

JavaScript

function x(a) {
  return $.post("/echo/html/", {
  	html: "a = " + a,
    delay: Math.random()
  });
}
function doIt(apiRequestList) {
  $.when.apply(null, apiRequestList).then(function() {

      var _arguments = arguments;
      if (Array.isArray(apiRequestList) && apiRequestList.length === 1)
          _arguments = [arguments];

      for (var i = 0; i < _arguments.length; i++) {
          var value = _arguments[i][0];
          console.log(value);
      }
      console.log("----");
  });
}
doIt([x(1), x(2), x(3)]);
doIt([x(4)]);