4 ms·
If you want to treat your table (list) as integer indexed array (i.e. this is just called "array" in many other languages), and use length '#' operator, yes, yo
by nezirus 6y ago
If you want to treat your table (list) as integer indexed array (i.e. this is just called "array" in many other languages), and use length '#' operator, yes, you need to start at index 1, however, you can use 0 otherwise, or even strings.
Lua is a small language, and tables are the basic building blocks for arrays, dictionaries, classes, modules, ...
1-based indexing is IMHO a small price to pay for such flexible and efficient syntax, with small cognitive load)