|
@@ -1,9 +1,7 @@
|
|
|
-let currency;
|
|
|
+
|
|
|
const wrapper = document.querySelector('.cur__wrapper');
|
|
|
-//confirm('You want to see all currency names?') ? showCurencys() : exchange();
|
|
|
|
|
|
-function exchange() {
|
|
|
- ///currency = prompt('enter currency for exchange (usd, eur, rub...etc)');
|
|
|
+function exchange(currency) {
|
|
|
let url = 'https://open.er-api.com/v6/latest/' + currency.toUpperCase();
|
|
|
if (currency.toLowerCase() === 'usd' || currency.toLowerCase() === 'eur' || currency.toLowerCase() === 'rub') {
|
|
|
fetch(url)
|
|
@@ -37,4 +35,5 @@ function showCurencys() {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+
|
|
|
showCurencys();
|