Maps are the Elixir key-value (also called dictionary or hash in other languages) type. You create a map using the %w{}
syntax:
%{} // creates an empty map
%{:a => 1, :b => 2} // creates a non-empty map
Keys and values can use be any type:
%{"a" => 1, "b" => 2}
%{1 => "a", 2 => "b"}
Moreover, you can have maps with mixed types for both keys and values":
// keys are integer or strings
%{1 => "a", "b" => :foo}
// values are string or nil
%{1 => "a", 2 => nil}
When all the keys in a map are atoms, you can use the keyword syntax for convenience:
%{a: 1, b: 2}