once i try to get a table that is inside another table by its index, it doesn’t work, but when i do that by its name, it does work, is there a reason for that ?
here is the output
here is the code
once i try to get a table that is inside another table by its index, it doesn’t work, but when i do that by its name, it does work, is there a reason for that ?
here is the output
here is the code
Dictionaries don’t have indices, arrays do. Values of dictionaries are accessed via their associated keys, values of arrays are accessed via their associated indices.
so i can’t get a value directly by using a number ?
Not from tables values which are structured as dictionaries.
local table1 = {342, 44, 3333, 454} --array
local table2 = {["Hello"] = true, ["world!"] = false} --dictionary
print(table1[1]) --displays 342
print(table2[1]) --error
print(table2["Hello"]) --displays true
i see, i will find a way around this, thanks for the answer