forked from TES3MP/CoreScripts
-
Notifications
You must be signed in to change notification settings - Fork 1
tables
HebiKotei edited this page Feb 27, 2023
·
6 revisions
local company = {
boss = "Sam"
}
local boss = company["boss"]
local boss = company.boss
This increases readability, but also increases performance as you are not accessing the table constantly.
local concatenation = myTable["key"] .. myTable["key"]
local myTableValue = myTable["key"]
local concatenation = myTableValue .. myTableValue
It is not efficient/performant, you should only use this when you need to insert at a specific index.
table.insert(myTable, "value")
myTable[#myTable + 1] = "value"
table.insert(myTable, "key", "value")
myTable["key"] = "value"