The getCountries function

The getCountries  function is going to get a list of countries, just their names, and we're going to get it by currencyCode:

const getCountries = (currencyCode) => {};

This one, just like getExchangeRate, is also going to return a promise from axios.get and the URL we want to get lives over in the browser:

So, right here we have our URL. We have the spot where we're going to dump our currencyCode, so we can knock that out. It's going to be a template string and we're going to get rid of CAD and inject whatever the currencyCode argument is:

const getCountries = (currencyCode) => { return axios.get(`https://restcountries.eu/rest/v2/currency/${currencyCode}`) ...

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.