middle

fun <T> List<T>.middle(): T

Returns the middle element, or the earlier of the two middle elements for even sizes.

Throws

when the list is empty.