4 ms·
If you want the array elements to shift into the gap, you want to use table.remove: local array = {1, 2, 3, 4} table.remove(array, 2) -- array is n
by groovy2shoes 14y ago
If you want the array elements to shift into the gap, you want to use table.remove:
local array = {1, 2, 3, 4}
table.remove(array, 2)
-- array is now { [1] = 1, [2] = 3, [3] = 4 }