function
boot.janet on line 1784 , column 1
(invert x )
Returns a table where the keys of `x` are the values , and the
values are the keys. If multiple keys in `x` are mapped to the same
value , only one of those values will become a key in the returned
table.
`x` can be a bytes , indexed , dictionary , or abstract type with a
suitable `next` method.
(invert [(chr "y" ) (chr "o" )])
# => @{111 1 121 0}
(invert :yo )
# => @{111 1 121 0}
(invert "yo" )
# => @{111 1 121 0}
(invert [:ant :bee :elephant :fox :penguin ])
# => @{:bee 1 :fox 3 :elephant 2 :ant 0 :penguin 4}
(invert {:a 1 :b 2 :c 3 })
# => @{3 :c 1 :a 2 :b}