我有一个对象数组,需要使用Google Closure。我需要将一些点符号转换为括号符号。
目前,我正在通过循环访问属性,像这样:
TheArray[i].MyProp1;
TheArray[i].MyProp2;
当我写代码时
TheArray[i].['MyProp1'];
这段代码无法转换。如何将其转换为对象数组中的括号表示法。
我有一个对象数组,需要使用Google Closure。我需要将一些点符号转换为括号符号。
目前,我正在通过循环访问属性,像这样:
TheArray[i].MyProp1;
TheArray[i].MyProp2;
TheArray[i].['MyProp1'];
这段代码无法转换。如何将其转换为对象数组中的括号表示法。