Last active
June 22, 2019 17:09
-
-
Save rxluz/1b699bb345625f013123fc8cf199146b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function run() { | |
var test = { | |
value: 0, | |
}; | |
const testss = await new Promise(accept => | |
setTimeout(() => ((test.value = 90), console.log(test.value), accept()), 0), | |
); | |
async function testing() { | |
return Promise.all([...Array(10)].map((value, index) => { | |
return new Promise(accept => | |
setTimeout(() => ((test.value = index), console.log(test.value), accept()), 0), | |
); | |
})); | |
} | |
var testt = await testing(); | |
console.log(test.value, "test va1lue"); | |
} | |
run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment