function convertCurrency(amount, fromCurrency, toCurrency, exchangeRate) {
return (amount * exchangeRate).toFixed(2);
}
let amount = 100;
let fromCurrency = “USD”;
let toCurrency = “EUR”;
let exchangeRate = 0.86;
console.log(amount + ” ” + fromCurrency + ” is equal to ” + convertCurrency(amount, fromCurrency, toCurrency, exchangeRate) + ” ” + toCurrency);