I trying to print all thing in this table but it dont work.
local t = {
["Hello"] = 2,
["World"] = 3
}
for i = 1, #t do
print(t[i])
end
I trying to print all thing in this table but it dont work.
local t = {
["Hello"] = 2,
["World"] = 3
}
for i = 1, #t do
print(t[i])
end
Use an generic loop to read table with key for index.
local t = {
["Hello"] = 2,
["World"] = 3
}
for i, v in next, t do
print(i, v)
end
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Ohh is named "generic"