Reputation: 440
I need to assign to withdraw the name of a variable from a dynamic string.
Ex. Thats wright:
Item.text = localizedStrings.report_label;
Thats wrong:
var localizedName = "localizedStrings.report_".concat(tempList[index].Name);
Item.text = localizedName;
Can someone tell me the way to do that??
Upvotes: 2
Views: 56
Reputation: 15154
try using bracket notation:-
var localizedName = localizedStrings["report_" + tempList[index].Name];
Item.text = localizedName;
Upvotes: 1