Interface representing a generic Stack ADT.
Readonly
Gets the number of elements in the collection.
Clears all elements from the collection.
Returns true if the collection is empty.
True if the collection is empty, otherwise false.
Returns the top element without removing it
The top element of stack, or undefined if stack is empty.
Removes and returns the top element of the stack
The removed element, or undefined if stack is empty.
Adds an element to the top of the stack
The element to add.
Interface representing a generic Stack ADT.