Skip to content

Instantly share code, notes, and snippets.

@chetanraj
Created August 15, 2021 12:37
Show Gist options
  • Save chetanraj/57771850cc167e7c2bd7807b6068425d to your computer and use it in GitHub Desktop.
Save chetanraj/57771850cc167e7c2bd7807b6068425d to your computer and use it in GitHub Desktop.
getBookByNamePromise
getBookByName('Art of War').then((book) => {
if (book) {
checkIfBookExists(book.ISBN).then((data) => {
console.log(data.stock > 0);
});
} else {
console.log('Book not found!');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment