Run to execute this JavaScript code for real (output appears here).
Size 0 / 3 · LIFO — the last value pushed is the first one popped
Ready.
A stack is Last-In-First-Out (LIFO): push adds to the top, pop removes from the top. A fixed capacity shows overflow (push when full) and underflow (pop when empty). Press Run (Ctrl + Enter) to animate, or Step forward (F10) to go one event at a time.
Step
1 / 24
Line (JavaScript)
—
No counted operations yet.
bottom [] top