table.maxn(table)<=> table.getn(table)
說明:回傳表最後一個不為nil的索引值。
範例:
> tbl = {[1] = "a", [2] = "b", [3] = "c", [26] = "z"}
> print(#tbl)
3 -- 因為26和之前的數字不連續, 所以不算在數組部分內
26
> tbl[91.32] = true
> print(table.maxn(tbl))
91.32