Answers for "lua empty table"

Lua
2

lua table is empty

if not next(myTable) then
    -- Table is empty
end
Posted by: Guest on September-27-2020
2

lua tables

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
Posted by: Guest on October-16-2020
0

lua empty table

for k,v in pairs(table) do 
 table.remove(table, k)
end
Posted by: Guest on March-22-2020

Browse Popular Code Answers by Language