loading
index.js
1
2
3
4
5
6
7
8
9
10
11
const waitFor = (ms) => new Promise(r => setTimeout(r, ms));
const getN = async n => n;

async function main() {
   for await (const n of [1, 2, 3].map(getN)) {
     await waitFor(1000);
     console.log(`main 'for await of' num=${n}`)
   }
}

main();