Enum

find_index/2

find_index(enumerable, fun)

Returns the index (zero-based) of the first element for which fun returns a truthy value.

If no such element is found it returns nil.