kotlin.collections.last

last

fun <T> Iterable<T>.last(): T

Returns the last element.

Exceptions

NoSuchElementException - if the collection is empty.

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

Returns the last element.

Exceptions

NoSuchElementException - if the list is empty.

inline fun <T> Iterable<T>.last(predicate: (T) -> Boolean): T
inline fun