function fetchCoinPrice(coinName) {
return axios
.get(
`https://min-api.cryptocompare.com/data/pricemulti?fsyms=${coinName}&tsyms=EUR`
).then((response) => (response.data[coinName]["EUR"]));
The JSON response for the coin "BTC" is: { "BTC": { "EUR": 8226.43 }} and the function returns the price as a promise.
How can I store the price value (8226.43) in a variable?