Skip to content

Instantly share code, notes, and snippets.

@Rahmanism
Last active January 7, 2023 09:16
Show Gist options
  • Save Rahmanism/26d4955c346fdc6b4ac98f7b7f22cd28 to your computer and use it in GitHub Desktop.
Save Rahmanism/26d4955c346fdc6b4ac98f7b7f22cd28 to your computer and use it in GitHub Desktop.
JavaScript wait function with promise
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