last

open fun last(): T

Get the last element or throw an exception if there is no such element.

Return

T the last element

Throws

if sequence is empty.


open fun last(condition: T.() -> Boolean): T

Get the last element by condition or throw an exception if there is no such element.

Return

T the last element

Parameters

condition

filter condition

Throws

if sequence is empty.