Created
February 11, 2020 16:19
-
-
Save gsampath127/eaf683eed0ff7a19b58cedb17e1b98d4 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 newBike = new Promise((resolve,reject)=>{ | |
let wishToBuy = false; | |
if(wishToBuy){ | |
resolve({"Product":"Harley-Davidson Fat Boy","Price":"15L"}); | |
} | |
else{ | |
reject({"reason":"Bike is not up to expectations"}); | |
} | |
}); | |
let newCar = new Promise((resolve,reject)=>{ | |
let wishToBuy = false; | |
if(wishToBuy){ | |
resolve({"Product":"Volkswagen","Price":"20L"}); | |
} | |
else{ | |
reject({"reason":"Car is not up to expectations"}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment