Map.get
You're seeing just the function
get
, go back to Map module for more information.
Specs
Gets the value for a specific key
in map
.
If key
is present in map
then its value value
is
returned. Otherwise, default
is returned.
If default
is not provided, nil
is used.
Examples
iex> Map.get(%{}, :a)
nil
iex> Map.get(%{a: 1}, :a)
1
iex> Map.get(%{a: 1}, :b)
nil
iex> Map.get(%{a: 1}, :b, 3)
3