Why do Lua arrays count from One not Zero?
Oddly, the thing that really gets some people overexcited is that in Lua array indices count from one. In mathematical notation array indices count from one, and so does Lua. In other words, they are not offsets. You can make your arrays start with zero, but the standard library functions (such as table.concat) will not recognize the zeroth entry. And # will return the size plus one.
Oddly, the thing that really gets some people overexcited is that in Lua array indices count from one. In mathematical notation array indices count from one, and so does Lua. In other words, they are not offsets. You can make your arrays start with zero, but the standard library functions (such as table.concat) will not recognise the zeroth entry. And # will return the size minus one.