So I saw this script but I forgot it it used something like square brackets
Table[] = string
but I forgot what it was
So I saw this script but I forgot it it used something like square brackets
Table[] = string
but I forgot what it was
These would be considered the same:
local array = {}
table.insert(array, 1, "String")
array[1] = "String"
In table.insert the IndexPosition (second parameter) must be a number
In the second example, the index (inside the brackets) is generally a string, but it can also be a number
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
t[#t + 1] = "string" behaves like table.insert(t, "string"). t[n] behaves like table.insert(t, n, "string").