const array = [1, 2, 3, 4, 5];
function someAsyncFunc(data) {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve(data);
}, 5000);
});
}
(async () => {
for (let a of array) {
const result = await someAsyncFunc(a);
console.log(result);
}
})();