A.OrdMap.last

You're seeing just the function last, go back to A.OrdMap module for more information.
Link to this function

last(ord_map, default \\ nil)

View Source

Specs

last(t(k, v), default) :: {k, v} | default
when k: key(), v: value(), default: term()

Finds the last {key, value} pair in ord_map.

Returns a {key, value} entry if ord_map is non-empty, or nil else. Can be accessed efficiently due to the underlying vector.

Examples

iex> A.OrdMap.new([b: "B", d: "D", a: "A", c: "C"]) |> A.OrdMap.last()
{:c, "C"}
iex> A.OrdMap.new([]) |> A.OrdMap.last()
nil
iex> A.OrdMap.new([]) |> A.OrdMap.last(:error)
:error