Javascript-将动态字符串分配给变量
我需要赋值以从动态字符串中提取变量的名称 前。 这就是赖特:Javascript-将动态字符串分配给变量,javascript,jquery,Javascript,Jquery,我需要赋值以从动态字符串中提取变量的名称 前。 这就是赖特: Item.text = localizedStrings.report_label; 这是错误的: var localizedName = "localizedStrings.report_".concat(tempList[index].Name); Item.text = localizedName; 有人能告诉我怎么做吗 尝试使用:- 当然,secont部分在一个周期内 var localizedName = locali
Item.text = localizedStrings.report_label;
这是错误的:
var localizedName = "localizedStrings.report_".concat(tempList[index].Name);
Item.text = localizedName;
有人能告诉我怎么做吗 尝试使用:-
当然,secont部分在一个周期内
var localizedName = localizedStrings["report_" + tempList[index].Name];
Item.text = localizedName;