
Stack – JavaScript Implementation - kevinhack
https://github.com/WithGJR/stack-js-implementation
======
Dx2m8zHX
Sorry, but [http://codetunnel.com/9-javascript-tips-you-may-not-
know/#st...](http://codetunnel.com/9-javascript-tips-you-may-not-know/#stack)

~~~
kevinhack
I need to limit the size of the stack and I want to remove the bottom-most
element of the stack before pushing the new element to the top-most position
of the stack if the stack has reached the max size.

I think if I use the traditional array, it will be very slow because you need
to spend a lot of time on moving, so I finally decide to write my own stack
implementation using linked-list.

