Module:User:Surjection/lua51compat

Hello, you have come here looking for the meaning of the word Module:User:Surjection/lua51compat. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:User:Surjection/lua51compat, but we will also tell you about its etymology, its characteristics and you will know how to say Module:User:Surjection/lua51compat in singular and plural. Everything you need to know about the word Module:User:Surjection/lua51compat you have here. The definition of the word Module:User:Surjection/lua51compat will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:User:Surjection/lua51compat, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.


local export = {}

function export.table_getn(t)
	return (t.n and type(t.n) == "number" and (t.n % 1) == 0) and t.n or #t
end

function export.table_maxn(t)
	local n = 0
	for k, _ in pairs(t) do
		if type(k) == "number" and k > n then
			n = k
		end
	end
	return n
end

return export