2013-10-30 41 views

回答

3

這是

test['line'+1] = '3' 

點語法不允許計算的關鍵。

0

test.line1=3;

將做必要的。

0

你需要使用bracket notation,因爲你有一個可變密鑰

test["line"+1] ="3"; 
0

要訪問這樣的鑰匙,你需要使用方括號語法如

test["line" + 1] = 3 
0

爲了存取權限元素你必須糾正這樣的代碼

test["line"+1] ="3";