What would be an elegant way for converting a list of two item tuples like [{1,2},{3,4}]
into the map %{1=>2, 3=>4}
?
Keyword list would be trivial, but what if we have arbitrary keys?
The simplest way to do this is:
Enum.into(list, %{})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With