maxOrNull

Returns the largest element or null if there are no elements.

If any of elements is NaN returns NaN.

Since Kotlin

1.4

fun <T : Comparable<T>> Array<out T>.maxOrNull(): T?(source)

Returns the largest element or null if there are no elements.

Since Kotlin

1.4