Skip to content

Instantly share code, notes, and snippets.

@josser

josser/test.js

Created May 17, 2020
Embed
What would you like to do?
function timedLog(value, ms) {
return new Promise((resolve, reject) => {
setTimeout(() => {
console.log(value)
resolve()
}, ms)
})
}
async function doSomething() {
let arr = [300, 200, 100]
for (let i of arr) {
await timedLog(i, i)
}
}
doSomething()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment