Creating convertCurrencyAlt as the async/await function

We are going to convert this over to async/await, and you're going to do that right here at the end of convertCurrency function. We're going to use Create convertCurrencyAlt as async function. So, just like we did over inside of app-promises, you're going to create an async function. Then you're going to fetch both pieces of data using await: Get countries and rate using await and our two functions. So, you're going to await both of these promises and then you're going to store that value in some variable. You can create a country's variable and a rate variable. Finally, you'll be able to take these two lines and just tack those on at the end:

const exchangedAmount = amount * rate;

Get Advanced Node.js Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.