2011-12-08 90 views

回答

1

S1是可變的,它包含數組,包含數組,包含數組:)

我們可以簡化您的代碼,這樣的:

s1=[ //this is first Array 
    [ // this is first and last element of previous Array, and it is Array too 
     [1, 10], // elements of Array, they are Arrays too and contain 2 numbers 
     [3,5.12], 
     [5,13.1], 
     [7,3], 
     [9,8], 
     [11,2] 
    ] 
]; 

如果我們希望得到一個號碼,例如5,你可以這樣做:

console.log(s1[0][2][0]); // 5 
相關問題