Created
February 11, 2020 16:05
-
-
Save gsampath127/edb267cfca23558539106fb25833f181 to your computer and use it in GitHub Desktop.
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
let newMobile = new Promise((resolve,reject)=>{ | |
// searching for a new mobile (asynchronous operation) | |
let wishToBuy = true; | |
if(wishToBuy){ | |
resolve({"Product":"iPhone 11","Price":"1L"}); | |
} | |
else{ | |
reject({"reason":"Mobile is not up to expectations"}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment