If you mean C (and you are), then no. If you try to access an array with a negative index, you will get an exception from the limits. However, Lua implements this thing as a function. If you access a Lua array with an index of -1, it will read the last element of the array. Index -2 will read the second-last element and so on.
Side note: you can annoy your colleagues by writing this
foo = {1,2,3,4,5,6,7,8,9,0} print(foo.length() * -1])
It prints 1. Annoying, isn't it.
source share