Created
August 15, 2021 12:41
-
-
Save chetanraj/318045ba7840ba981de452a6bdafa4dd to your computer and use it in GitHub Desktop.
getBookByNamePromise
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
getBookByName('Art of War').then((book) => { | |
if (book) { | |
checkIfBookExists(book.ISBN).then((data) => { | |
if (data.stock > 0) { | |
getTheBookPrice(data.ISBN).then((response) => { | |
console.log(response.offers.booksrun.new.price); // uff 😅 | |
}); | |
} | |
}); | |
} else { | |
console.log('Book not found!'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment