How to add something to the end of a table

I know this is quite silly but I have a question.

To add something to the end of a table would you just do:

table.insert(a, #a, Value)

or would you have to do this:

table.insert(a, #a + 1, Value)

Im confused…

1 Like

IIRC, If you leave out the length argument, it will put your value at the end of the table.

1 Like

So would it be like this:


table.insert(a, Value)

?

Yes, I believe that is correct.

1 Like

Ok thanks. I just remember doing something like that and it errored. But it probably will work now (Because I am smarter now :P)