min By
Returns the first element yielding the smallest value of the given function.
Since Kotlin
1.7Samples
samples.collections.Collections.Aggregates.minByThrows
if the array is empty.
Returns the first element yielding the smallest value of the given function.
Since Kotlin
1.7Samples
samples.collections.Collections.Aggregates.minByThrows
if the collection is empty.
inline fun <K, V, R : Comparable<R>> Map<out K, V>.minBy(selector: (Map.Entry<K, V>) -> R): Map.Entry<K, V>(source)
Returns the first entry yielding the smallest value of the given function.
Since Kotlin
1.7Samples
samples.collections.Collections.Aggregates.minByThrows
if the map is empty.
inline fun <K, V, R : Comparable<R>> Map<out K, V>.minBy(selector: (Map.Entry<K, V>) -> R): Map.Entry<K, V>?(source)
Deprecated
Warning since 1.4
Error since 1.5
Hidden since 1.6
Use minByOrNull instead.
Replace with
this.minByOrNull(selector)Content copied to clipboard
Since Kotlin
1.0@ExperimentalUnsignedTypes
@ExperimentalUnsignedTypes
@ExperimentalUnsignedTypes
@ExperimentalUnsignedTypes
Deprecated
Warning since 1.4
Error since 1.5
Hidden since 1.6
Use minByOrNull instead.
Replace with
this.minByOrNull(selector)Content copied to clipboard