Setting the value to nil effectively removes the key from the table.
Also, ipairs halts when it hits the first nil value (and it can't read the key afaik), and it also is slower than any other option.
Use pairs, or better yet, next for your iteration needs.
Code:
local t = {
[1] = true,
[2] = nil,
[3] = false
}
for k, v in ipairs(t) do
print('ipairs', k, v)
end
-- prints [1] = true
for k, v in next, t do
print('next', k, v)
end
-- prints [1] = true, [3] = false
ipairs is basically the equivalent of a for loop for associative arrays, and should only be used if necessary.