firstOrNull

fun <T, D : Dimension> MultiArray<T, D>.firstOrNull(): T?

Returns the first element, or null if the collection is empty.


inline fun <T, D : Dimension> MultiArray<T, D>.firstOrNull(predicate: (T) -> Boolean): T?

Returns the first element matching the given predicate, or null if element was not found.