How do I delete all elements inside a Lua table? I don\'t want to do:
t = {} table.insert(t, 1) t = {} -- this assigns a new pointer to t
I w
for k in pairs (t) do t [k] = nil end
Will also work - you may have difficulty with ipairs if the table isn't used as an array throughout.