Mae
0
Q:

lua empty table

if not next(myTable) then
    -- Table is empty
end
1
local favoritefoods_table = {"hamburger", "spaghetti", "pizza", "potato chips"}
--the table--

for i, v in pairs(favoritefoods_table) do --loop through the table-- 
	print(i) --print the number--
  	print(v) --print the value--
end
0
for k,v in pairs(table) do 
 table.remove(table, k)
end
0

New to Communities?

Join the community