Stacks

introduction to stacks and stack size limits in Javascript

We'll cover the following...

We will need a basic understanding of how stacks work to understand the next section. If you have never heard of a stack data structure, I will summarize it in this section. I still encourage you to do more thorough research before continuing, as you will need it in your programming career.

Imagine a stack like a JavaScript array whose elements are not accessible. Suppose stack S is given. You can only execute the following operations on it:

  • S.length: checks the length of the stack
  • S.push(element): pushes an element to
...