List.last

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

last(list, default \\ nil)

View Source

Specs

last([], any()) :: any()
last([elem, ...], any()) :: elem when elem: var

Returns the last element in list or default if list is empty.

last/2 has been introduced in Elixir v1.12.0, while last/1 has been available since v1.0.0.

Examples

iex> List.last([])
nil

iex> List.last([], 1)
1

iex> List.last([1])
1

iex> List.last([1, 2, 3])
3