Skip to content

Glossary: Data Structures and Algorithms in JavaScript

Push, pop, peek

Also written: push, pop, peek

Stack operations: push adds to the top, pop removes the top item, and peek looks at the top without removing it. All are O(1).

Where the book teaches it

Related terms

Stack