async function getDetails(country){
let response = await fetch(`https://restcountries.com/v2/name/${country}`);
let [data]= await response.json();
return data
}
let portugal = getDetails('portugal');
Is there a way to store the data returned from a async function in JavaScript?
I know, the async function will always return a promise, and can use ".then(func)" to do another thing with the data. But how can i store it in a variable and use it later?