Implementing stack in Javascript with TDD

Stacks are everywhere. Even the most popular programming website www.stackoverflow.com has stack in its domain. Everyone seems to talk about stacks all the time. When we code in Java quite often our computers presents us with beautiful java.lang.StackOverFlowError.

When we do it in Javascript we are blessed with Maximum call stack size exceeded.

If you never got any of these, then hats off. Otherwise, if you do encounter them and would like to know more about stack data structure…