Skip to content

Stack

Class | Source Code

implements IStack

Implementation of a stack, a FILO (first in, last out) data structure.

Whether the stack is empty.


The number of items in the stack.

Clears the stack entirely.


Shows you the first item in the stack without removing it.

The first item in the stack, or undefined if the stack is empty.


Pops the first item on the stack off. This mutates the stack.

The popped item, or undefined if the stack is empty.


Pushes an item onto the stack, making that item the first one in the stack.


The stack as an array.


The stack as a human-readable string.