If I am going to use the below example, should I declare a variable (initialize it with zero value in JS) or just use it normally later?
// Currency Converter
var currencyOne = 100; // $
var currencyTwo = 0; // Shall we do this to use as below for printing the result out or no need in JS to declare it with zero value?
var exchangeRate = 19.66; // EGP for Example
function CurrencyConverter(amount, rate) {
return amount * rate;
}
var currencyTwo = CurrencyConverter(currencyOne, exchangeRate); //I mean to use it here without any declaration first
console.log(currencyTwo);