JSFiddle - React, Tailwind, and code Playground
Babel + JSX
function ajaxPromise(indice) {
return new Promise(resolve => {
$.post('/echo/html/', {html:'server response ' + indice}).then(resolve);
});
}
async function asyncLoop() {
for(let i=0; i<10; i++) {
var rsp = ajaxPromise(i);
console.log('after ajax', i, await rsp);
}
}
asyncLoop();