The stack is one of the most commonly used data structures in computer science and the basis for many of our favourite programming languages, JavaScript being a major one. As developers we need to be aware of the way it works behind the scenes and the nuances behind working with stacks.

The Stack Data Structure

A stack is a type of data structure that puts data in a sequential order, known as a linear data structure. Stacks also follow a Last in, First Out (LIFO) principle where only the last element added to the stack can be accessed.

A good way to imagine this…

Rene Wang

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store