A table inside a table in Lua

How can I get data that is a table inside a table, I mean like this:

t = { {a, b, c}, {d, e, f} }; 

if I write this line of code:

 print( t[1] ) 

the result will be → → {a, b, c}

BUT

How can I print only the letter "a"? without using ipairs I mean, is there a way to use something like t[1] ?

+6
source share
1 answer

Have you tried t[1][1] ? This should give you the first index in the table you get from t[1]

+9
source

Source: https://habr.com/ru/post/893455/


All Articles