const myPromise = num=>{ return new Promise((resolve,reject)=>{ setTimeout(()=>{ resolve(num) },1000) }) } async function test(){ for(let i = 0;i<5;){ i++ console.log(await myPromise(i)); } } test()
const myPromise = num=>{ return new Promise((resolve,reject)=>{ setTimeout(()=>{ resolve(num) },1000) }) } async function test(){ for(let i = 0;i<5;){ i++ console.log(await myPromise(i)); } } test()