Last active
September 28, 2024 16:05
-
-
Save mrienstra/8aa4eeeeab2012d2aa8ffc7f5e45f280 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
await new Promise(function (resolve) { | |
setTimeout(function () { | |
resolve(); | |
}, 1000); | |
}); | |
// ... Can be shortened to: | |
await new Promise(function (resolve) { | |
setTimeout(resolve, 1000); | |
}); | |
// ... Can be shortened to: | |
await new Promise((resolve) => { | |
setTimeout(resolve, 1000); | |
}); | |
// ... Can be shortened to: | |
await new Promise((resolve) => setTimeout(resolve, 1000)); | |
// ... Can be shortened to: | |
await new Promise(resolve => setTimeout(resolve, 1000)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
very nice & clear explanation, laid out very well!
I like it, to the point!