Lua learning notes – (3) – table data structure

Time:2020-9-27
mytab = {}

mytab["k1"]="hello-val-1"
mytab.k2 = "lua-val-2"
mytab[1] = 3

for k,v in pairs(mytab) do
  print(k, v)
end