function empty()
print("table empty")
end
-- Place i need help with --
✓ ANSWER ACCEPTED
How to check if a table is empty?
3 answers
✓ Accepted answer
Using #Table will give you the length of it.
table = {182}
function is_empty(x)
if #table<=0 then
return true
end
end
`
if #table < 1 then
print("Table is empty.")
end
Hope that helped^
You can do a few things.
local t = {}
if #t < 1 then
--do code
end
if not t[1] then
--do code
end
for i,v in pairs(t) do
if not v then
--do code
end
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
loooooool