如果一個table中同時有映射和數組如
a={
10,
20,
["hello"]=250,
[2]=30
}
print(a[2])
則優先輸出數組
a={
10,
20,
["hello"]=250,
[2]=30
}
print(a[2])
則優先輸出數組
2019-06-24
拓展測試
a={
10,
20,
["hello"]=250,
30
}
print(a[3])
Table的組合定義,無key值定義默認會自動延續下標,如上代碼,結果a[3]=30
a={
10,
20,
["hello"]=250,
30
}
print(a[3])
Table的組合定義,無key值定義默認會自動延續下標,如上代碼,結果a[3]=30
2019-04-10