4 ms·
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
by ufo 6y ago
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 https://www.lua.org/manual/5.4/manual.html#3.4.7