Last active
January 7, 2023 09:16
-
-
Save Rahmanism/26d4955c346fdc6b4ac98f7b7f22cd28 to your computer and use it in GitHub Desktop.
JavaScript wait function with promise
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
function wait(time) { | |
return new Promise(resolve => { | |
setTimeout(resolve, time) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment