KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
In Lua, you can create a table the following way: local t = { 1, 2, 3, 4, 5 } However, I want to create an associative table, I have to do it the following way: local t = {} t['foo'] = 1 t['bar'] = 2 The following gives an error: local t = { 'foo' = 1, 'bar' = 2 } Is there a way to do it similarly to my first code snippet?
Tags (comma-separated)
Save Edits
Cancel