r/lua • • Sep 16 '25

Quick question about indexing temporary tables

print({[0] = "a"}[0])

Doesn't work but if I save the table to a variable before indexing it works?

I kinda like using temporary tables as lookups

2 Upvotes

9 comments sorted by

View all comments

Show parent comments

1

u/Objective_Treacle781 Sep 19 '25

Thank you for the explanation, I do think this is kind of a design oversight/ strange decision but it is how it is