Enum.find
You're seeing just the function
find
, go back to Enum module for more information.
Specs
Returns the first element for which fun
returns a truthy value.
If no such element is found, returns default
.
Examples
iex> Enum.find([2, 3, 4], fn x -> rem(x, 2) == 1 end)
3
iex> Enum.find([2, 4, 6], fn x -> rem(x, 2) == 1 end)
nil
iex> Enum.find([2, 4, 6], 0, fn x -> rem(x, 2) == 1 end)
0