I have these imaginary exchange rates:
var eur2usd = '0.90';
var eur2gbp = '1.20';
var usd2eur = '1.10';
var usd2gbp = '1.28';
var gbp2eur = '0.85';
var gbp2usd = '0.78';
(the values are assigned to the variables dynamically -and that works fine)
Then I have 2 more variables:
var firstPart = 'usd'; //also assigned dynamically (can be usd, eur or gbp)
var secondPart = 'eur'; //also assigned dynamically (can be usd, eur or gbp)
When I do:
alert(firstPart+'2'+secondPart);
the result I get is "usd2eur".
So far I managed to construct and alert the name of the variable, but I would like to get its actual value as set before (which in this case is: "1.10") and not it's name.
Any ideas?