Created
January 1, 2021 07:07
-
-
Save shahab570/696177b18ee7867c9c222207a24ceb8d 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
const promise = new Promise((resolve, reject) => { | |
has_money = false; | |
setTimeout(() => { | |
if (has_money) { | |
resolve("Here is your car. Enjoy your ride"); | |
} else { | |
reject("Sorry, I don't have money to buy car"); | |
} | |
}, 5000); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment