-
-
Save acacha/f10db679bb05254a99a79f1f7ba36203 to your computer and use it in GitHub Desktop.
Wait -- an ES6 promise example
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 = time => new Promise((resolve) => setTimeout(resolve, time)); | |
wait(3000).then(() => console.log('Hello!')); // 'Hello!' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment