-3
好吧,這聽起來很簡單,但這可能在JavaScript中。我有一個對象(陣列),如DIS在JavaScript中訪問索引數組
questions{
0:
{A:"A in index 0",
B:"B in index 0",
C:"C in index 0"
},
1:
{A:"A in index 1",
B:"B in index 1",
C:"C in index 1"
},
2:
{A:"A in index 2",
B:"B in index 2",
C:"C in index 2"
}
}
我怎麼做這樣的事情
questions[0].A; //output : A in index 0
questions[2].B; //output : B in index 2
這是否不行? – JJJ
不應該問''''問題:{'或'questions = {' –
不,它給我一個未定義的錯誤 – kolexinfos