Enum.take_every
You're seeing just the function
take_every
, go back to Enum module for more information.
Specs
take_every(t(), non_neg_integer()) :: list()
Returns a list of every nth
element in the enumerable
,
starting with the first element.
The first element is always included, unless nth
is 0.
The second argument specifying every nth
element must be a non-negative
integer.
Examples
iex> Enum.take_every(1..10, 2)
[1, 3, 5, 7, 9]
iex> Enum.take_every(1..10, 0)
[]
iex> Enum.take_every([1, 2, 3], 1)
[1, 2, 3]