📜  如何在 lua 代码示例中制作表格

📅  最后修改于: 2022-03-11 14:54:54.237000             🧑  作者: Mango

代码示例3
a = {}
    x = "y"
    a[x] = 10                 -- put 10 in field "y"
    print(a[x])   --> 10      -- value of field "y"
    print(a.x)    --> nil     -- value of field "x" (undefined)
    print(a.y)    --> 10      -- value of field "y"