Lua Hash Table Length

[Solved] Lua Hash Table Length | Lua - Code Explorer | yomemimo.com
Question : lua hash table length

Answered by : hot-big-hot-sexy-man

-- 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

Source : https://stackoverflow.com/questions/652957/how-do-i-get-the-number-of-keys-in-a-hash-table-in-lua | Last Update : Fri, 18 Dec 20

Answers related to lua hash table length

Code Explorer Popular Question For Lua