RosettaCodeData/Task/Hash-from-two-arrays/Elixir/hash-from-two-arrays.ex
2024-10-16 18:07:41 -07:00

6 lines
175 B
Elixir

iex(1)> keys = [:one, :two, :three]
[:one, :two, :three]
iex(2)> values = [1, 2, 3]
[1, 2, 3]
iex(3)> Enum.zip(keys, values) |> Enum.into(Map.new)
%{one: 1, three: 3, two: 2}