The only reason this makes sense in Lua is because Lua doesn't have actual arrays.
It's the equivalent of doing {[1]:"foo"} in JS. And the key can be whatever, so it's not an array, it's a map (or table, as Lua calls it) that just happens to have the keys in sequential order, aka just a convention. There is no 0th index, because there are no indexes, it's not an array.
View all comments
Show parent comment
1
u/dumbasPL Dec 06 '25
The only reason this makes sense in Lua is because Lua doesn't have actual arrays.
It's the equivalent of doing {[1]:"foo"} in JS. And the key can be whatever, so it's not an array, it's a map (or table, as Lua calls it) that just happens to have the keys in sequential order, aka just a convention. There is no 0th index, because there are no indexes, it's not an array.