Closed odv closed 4 years ago
function exchange(a) {
fetch('https://api.exchangeratesapi.io/latest')
.then((response) => {
return response.json();
})
.then((myJson) => {
console.log(`${myJson.rates.GBP}`);
})}
function exchange(euro) {
fetch('https://api.exchangeratesapi.io/latest')
.then((response) => {
return response.json();
})
.then((myJson) => {
console.log(`${myJson.rates.GBP * euro}`);
})}
You should have one method in your object called "exchange". This method should accept an integer(representing amount in EUR). Your method should return an integer, representing the amount from input converted to GBP.
https://exchangeratesapi.io/