Skip to content

Instantly share code, notes, and snippets.

@chetanraj
Created August 15, 2021 12:41
Show Gist options
  • Save chetanraj/318045ba7840ba981de452a6bdafa4dd to your computer and use it in GitHub Desktop.
Save chetanraj/318045ba7840ba981de452a6bdafa4dd to your computer and use it in GitHub Desktop.
getBookByNamePromise
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