Last active
January 1, 2021 07:05
-
-
Save shahab570/7f71e05d7d83f97a32511adec45c2aa2 to your computer and use it in GitHub Desktop.
car promsie
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 = true; | |
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