I’m confused at this, is this like having a key and a sub key?
local testtable = {}
local item = testtable[one][two]
I understand this
local testtab = {}
local item = testtab[one]
I’m confused at this, is this like having a key and a sub key?
local testtable = {}
local item = testtable[one][two]
I understand this
local testtab = {}
local item = testtab[one]
It checks for the key inside the table defined by the key one
Basically this:
local myTable = {
["Hello"] = {
["Hey"] = "Hi"
}
}
print(myTable["Hello"]["Hey"])
can you do the same thing for creating values to?
like for example
myTable["bob"]["cool"] = 77
No, for that you would need to create a table for bob example:
local myTable = {}
myTable["bob"] = {}
myTable["bob"]["cool"] = 7
print(myTable["bob"]["cool"]) -- 7