List.pop_at
You're seeing just the function
pop_at
, go back to List module for more information.
Specs
Returns and removes the value at the specified index
in the list
.
Negative indices indicate an offset from the end of the list
.
If index
is out of bounds, the original list
is returned.
Examples
iex> List.pop_at([1, 2, 3], 0)
{1, [2, 3]}
iex> List.pop_at([1, 2, 3], 5)
{nil, [1, 2, 3]}
iex> List.pop_at([1, 2, 3], 5, 10)
{10, [1, 2, 3]}
iex> List.pop_at([1, 2, 3], -1)
{3, [1, 2]}