Lua How to check what index belongs to value
snippet in lua

Lua How to check what index belongs to value

user1146

local index={}
for k,v in pairs(values) do
   index[v]=k
end
return index["a"]