gabrielfv
11/29/2018, 4:30 PMIterable
class, which takes a (T) -> Boolean
predicate and returns IndexedValue<T>
?orangy
.indexOfFirst { }
gabrielfv
11/29/2018, 6:24 PM.takeIf { it >= 0 }?.let { Pair(it, list[it]) }
. Works, thoughilya.gorbunov
11/29/2018, 8:41 PMIndexedValue
in the end, you can try .withIndex().find { predicate(it.value) }