Flips key-value pairs of each element within a table, so that each value becomes the key, and each key becomes the value.
Take care when using this function, as a Lua table cannot contain multiple instances of the same key. As such, data loss is possible when using this function on tables with duplicate values.
local test ={ test =1, test2 =1}local f =table.Flip( test )
PrintTable( f )
-- Outputs "1 = test2"