Last active
October 2, 2020 12:32
-
-
Save nsacerdote/03abc60f5fa8fb7f02c23b229006d124 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
log('Waiting one second'); | |
wait(1000) | |
.then(() => log('I waited for one second')) | |
.catch((err) => log('Something went wrong' + err)); | |
log('Meanwhile checking twitter'); | |
function wait(ms) { | |
return new Promise((resolve, reject) => { | |
log('Inside Promise ---> Started waiting') | |
setTimeout(() => resolve(), ms); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment