📅  最后修改于: 2022-03-11 14:54:54.176000             🧑  作者: Mango
-- there is no way to achieve this other than to create your own function.
-- using #table ("#" is shorthand for table.getn(table)) won't factor in key names.
function table_length(t)
local z = 0
for i,v in pairs(t) do z = z + 1 end
return z
end