How to get it to fetch the property ABC
instead of A
? Considering this code:
A = 'ABC';
alert(LANG.A);
How to get it to fetch the property ABC
instead of A
? Considering this code:
A = 'ABC';
alert(LANG.A);
The LANG.A
of your example looks for a property named A
on object LANG
. Already LANG[A]
looks for a property whose name is the value of the variable A
, that is, 'ABC'
- so it equals LANG.ABC
. I think you're wanting that second case.