RosettaCodeData/Task/Associative-array-Iteration/Lua/associative-array-iteration.lua

10 lines
146 B
Lua
Raw Permalink Normal View History

2015-02-20 00:35:01 -05:00
local t = {
2013-04-10 14:58:50 -07:00
["foo"] = "bar",
["baz"] = 6,
2015-02-20 00:35:01 -05:00
fortytwo = 7
2013-04-10 14:58:50 -07:00
}
2015-02-20 00:35:01 -05:00
for key,val in pairs(t) do
print(string.format("%s: %s", key, val))
2013-04-10 14:58:50 -07:00
end