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