When declaring a map, I noticed that there are two ways to specify a key/value pair.
① m1 = %{:a => 1, 2 => :b}
② m2 = %{a: 1, b: 2}
Both of these contain the key of :a (atom whose value is “a”), and such, the value can be retrieved using the same syntax: m1[:a] and m2[:a].
Is there a difference between using the => and the :? I noticed you also cannot mix them when declaring a map…