DEV Community

Discussion on: Creating 3 Stacks With 1 Array in JavaScript

Collapse
 
jimbotsov profile image
JimboTSoV • Edited

Edit:
I just realized that you actually did that already, my bad!


I found this interesting, but in your leading paragraph you could probably add why you would use this. Is this simply meant to teach about stacks in general or do you have an example use case for Javascript at hand?

Collapse
 
emmabostian profile image
Emma Bostian ✨

Sure! This was a prompt from the Cracking The Coding Interview book. The exercise is: "Describe how you could use a single array to implement three stacks.":)