I want to wait on every iteration of the loop except the 1st one. This is my code which is working fine for 1st iteration after that setTimeout function wait for some x seconds and run all the iterations at once without wait.
Here is the code
var requests_made = 0;
drivers.forEach(function(driver) {
if (requests_made == 0) {
createUser(data);
} else {
setTimeout(function () {
createUser(data);
},30000);
}
requests_made++;
});
requests_madevar at the end of each loop, so by the second loop it would already be 1.