Example of bad code that will not work as expected:
local fooTable = { greeting = "hi!" }
local barTable = { "one" }
for k, v in fooTable do
print(k .. " is " .. v)
end
for k, v in barTable do
print(k .. " is " .. v)
end
Instead:
for k, v in pairs(fooTable) do
print(k .. " is " .. v)
end
for k, v in ipairs(barTable) do
print(k .. " is " .. v)
end