I tried fetching data from a giphy api using the following function and print the returned value to the browser console.
const fetchData = (url) =>
{
return axios.get(url).then(res => res.data.data);
}
const data = fetchData(giphy_url);
console.log(`Data: ${data}`);
But on printing the value of the data variable, it prints:
Data: [object Promise]
I want the data in the response to be accessed. Is there something that I am missing?