Do Lua table integers get forwarded when removing an element?

If I have a table, for example:

local myTable = {"Banana", "Apple", "Pear", "Watermelon"}

and I remove an element, for example:

table.remove(myTable, 1)

then do other element integers get forwarded to fill the gap print(myTable[1]) = Apple or does it just return a nil value?

It will shift down, yes, which is why it may be preferable in most cases to table.remove instead of removing it yourself (myTable[1] = nil)

1 Like

Thanks! Really helped me out! ^^