Re:Again on 0-based vs. 1-based indexing
by ufo on Wednesday January 20, 2021 @06:12PM
(#25853173)
The tricky thing is that the length operator in Lua (#) actually returns the largest integer index in the table. If you use 1-based arrays, that also happens to be the number of elements in the table. However, if you use 0-based arrays then it won't count the zero-th element.
https://www.lua.org/manual/5.4/manual.html#3.4.7