JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://jquery-json.googlecode.com/files/jquery.json-2.2.min.js"></script>
JavaScript
function getUserData(username){
return $.ajax({
url:"/echo/json/",
data:{json: $.toJSON({"username": username}),
delay: 3},
type:"POST",
success:function(response)
{
console.log(response);
}
});}
var userList = ["userA", "userB"];
var userRequests = [];
userList.forEach(function(u){
userRequests.push(getUserData(u));
})