Created
May 29, 2018 16:16
-
-
Save jhenaoz/988dbafaaf9734c0424b26510e46b4c7 to your computer and use it in GitHub Desktop.
this is an example about 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(method, time) { | |
return new Promise((resolve) => { | |
setTimeout(resolve(method()), time); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment