How would I go about completely wiping or resetting a table in Lua. I want to make it into a blank table in the end.
You iterate over the keys and make them nil.
for k,v in pairs(t) do
t[k] = nil
end
If it's an array then remove values with table.remove()
What about this way?
t = {..some non-empty table..}
...some code...
t={}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With