there’s no documentation that references towards that table.remove(t, nil) would remove #t, the only thing that’s mentioned is if 0 is used it removes #t, this feels like an error in either documentation or unintentional error in the engine as utilizing table.remove(t, 0) doesn’t do anything
this oversight has caused a number of faulty behaviors as the expectation was that nil wouldn’t cause a removal of #t
You called out a couple issues with the remove function for tables. The first one is that the docs state that using 0 parameter can work with a numeric key set to 0 which doesn’t seem to work in practice. The second issue is that using ‘nil’ as a parameter seems to remove the last entry which isn’t documented.
I’ve verified that using 0 as a parameter doesn’t seem to work as expected and I’ve removed it from our documentation. I’ve also added a sentence regarding the default behavior if a pos was not provided (defaults to the length of the table, removing the last element) which would explain your ‘nil’ behavior as well.
Thanks again for raising this up and please reach out if you see any other discrepancies.