peek

fun peek(): T

Returns the item on the top of this stack without removing it.

If this stack is empty, an exception will be thrown.

Return

The item currently at the top of this stack.

Throws

If this stack is empty.