Let's say I have an Array {"Hi", "Bye", "Welcome"} and I want to add an "Potato" on the [4] how can I do that? Thanks!
Using table.insert
.
Pretty easy actually;
local aa={'a',1} table.insert(aa,3,'b') --1st argument is the table, 2nd one is the position, 3rd is the value(string, bool, int). --To make it so it's at the last position. table.insert(aa,#aa+1,'last')
EDIT* Made a mistake, 2nd argument is the position, the 3rd is the value.