The only thing about Lua's tables that consistently confuses people is the behavior of the length operator in the presence of "holes." The previous, somewhat confusing definition in Lua 5.1 (http://www.lua.org/manual/5.1/manual.html#2.5.5) has been replaced with:
The length of a table t is only defined if the table is a
sequence, that is, all its numeric keys comprise the set
{1..n} for some integer n. In that case, n is its length.
Note that a table like
{10, 20, nil, 40}
is not a sequence, because it has the key 4 but does
not have the key 3. (So, there is no n such that the
set {1..n} is equal to the set of numeric keys of
that table.) Note, however, that non-numeric keys do
not interfere with whether a table is a sequence.
A program can modify the behavior of the length
operator for any value but strings through the __len
metamethod.
(http://www.lua.org/work/doc/manual.html#3.4.6)