detect_index

docblock
detect_index(x, p)

Returns the index for the first element of x where p is true.