const axios = require('axios');
const exchangeRate;
axios.get('https://kurs.resenje.org/api/v1/currencies/eur/rates/today').then(function(response){
exchangeRate = response.data;
})
function one(){
console.log(exchangeRate);
}
I have code like this. This obviously wont work, but I hope that you get the idea. I tried many solutions online, non of which work. I tried with async await but I always got Promise returned instead of JSON.