ElEditors, Interface administrators, Administrators
70,975
edits
No edit summary |
No edit summary |
||
Line 79: | Line 79: | ||
end | end | ||
function table. | function table.containsKey(tbl, key) | ||
return | return tbl[key] ~= nil | ||
end | |||
function table.containsValue(tbl, val) | |||
local contains = false | |||
for k,v in pairs(tbl) do | |||
if (v == val) then | |||
contains = true | |||
break | |||
end | |||
end | |||
return contains | |||
end | end |