Last active
March 14, 2020 21:47
-
-
Save ivaneroshkin/235585f595d48ea09f3c150b8bf10dce to your computer and use it in GitHub Desktop.
This file contains 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
function wait(ms = 0) { | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
} | |
wait(200) | |
.then(() => { | |
console.log('Appeared after 200ms'); | |
return wait(500); | |
}) | |
.then(() => { | |
console.log('Appeared after 500ms'); | |
return wait(1000); | |
}) | |
.then(() => { | |
console.log('Appeared after 1s'); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment