https://cs.slides.com/colt_steele/stacks
A LIFO data structure!
The last element added to the stack will be the first element removed from the stack
How is it used?
- Think about a stack of plates, or a stack of markers, or stack of… anything
- As you pile it up the last thing (or the topmost thing) is what gets removed first.
How we’ll visualize a stack

We’ve seen this before - the call stack!
Where stacks are used
- Managing function invocations
- Undo / Redo
- Routing (the history object) us treated like a stack!