RosettaCodeData/Task/Associative-array-Iteration/Lua/associative-array-iteration.lua
2013-04-10 14:58:50 -07:00

8 lines
149 B
Lua

local table = {
["foo"] = "bar",
["baz"] = 6,
42 = 7,
}
for key,val in pairs(table) do
print(string.format("%s: %s\n", key, val)
end