var ccode = ['EUR', 'BRL', 'RUB', 'KRW', 'RON', 'CHF'];
var i;
for (var i = 0; i < ccode.length; i++) {
var ccode[i] = fx.convert(amount, {to: 'ccode[i]'});
}
The bit above var ccode[i]
is causing an error
SyntaxError: Unexpected token '['. Expected ';' after variable declaration.
I am still new to JS so please bear with me.
I am editing my question here since people asked why I was re-declaring var ccode[i] and its because I need to output this:
var EUR = fx.convert(amount, {to: "EUR"});