local tbl = {}
local tbl2 = {}
tbl[tbl2] = {position = 12}
tbl.tb2.position = 12
--Difference between those 2 on line 4 and 5?
COMMUNITY QUESTION
What is the difference between these syntaxes?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
Both of these are wrong. The first one tries to use a table as a key, which you can't do. The second one tries to index "position" of a nil value.
Tb2 doesn’t exist, not would correcting it to tbl2. It would need to be created vis table.insert() or initiated in tbl’s creation. This counts for position too.
Although you can use an array as an index, it is v e r y not recommended.
I don't really have a good understanding of how lua indexes work. So like if I had a foo variable with a value of 4 inside of a table, is the foo an index for the value of 4?