Sep 4, 2018 · 1 min read
sorry sir
you may get a error, you forget the “;”
just try
const waitFor = (ms) => new Promise(r => setTimeout(r, ms));[1, 2, 3].forEach(async (num) => {
await waitFor(50)
console.log(num)
})console.log('Done')
sorry sir
you may get a error, you forget the “;”
just try
const waitFor = (ms) => new Promise(r => setTimeout(r, ms));[1, 2, 3].forEach(async (num) => {
await waitFor(50)
console.log(num)
})console.log('Done')