NullableElementIterableExtension<T> extension

Extension methods for nullable Iterable<T?> to perform common operations such as finding the element that yields the highest value based on a selector.

on

Methods

maxBy<K extends Comparable>(K selector(T element)) → T?

Available on Iterable<T?>, provided by the NullableElementIterableExtension extension

Returns the element that yields the highest value based on the given selector. If the iterable is empty or all elements are null, it returns null.