|
|
|
|
|
by HiPhish
68 days ago
|
|
> There is nothing stopping you from doing someArray[0] = "the first item", you know. Yes, there is: local l = {[0] = 'a', [1] = 'b', [2] = 'c'}
for i, c in ipairs(l) do
print(i, c)
end
This will only print the last two pairs. Lua is 1-indexed, end of story. You can store values at index zero, but it's no different than storing values at index -1 or index 'lolrofl'. It does not exist in the array-part of the table as far as Lua is concerned. |
|