Created
November 29, 2018 11:05
-
-
Save danielt69/407f25f9a3389b5e71bfe29f7cbad300 to your computer and use it in GitHub Desktop.
a simple wait js function using Promise
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
const wait = ms => new Promise(resolve => setTimeout(resolve, ms)); | |
wait(10000).then(() => saySomething("10 seconds")).catch(failureCallback); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment