Simple realization of stack for javascript.
For testing you need to install some dependencies:
npm install
Then run tests:
npm test
Method for returning the size of the stack.
var stack = new Stack();
stack.push(6); // stack is now {0: 6}
stack.size(); // 1
Method for pushing items into the stack.
var stack = new Stack();
stack.push(15); // stack is now {0: 15}
Method for removing the last item from the stack.
var stack = new Stack();
stack.push(3); // stack is now {0: 3}
stack.push(8); // stack is now {0: 3, 1: 8}
stack.pop(); // return 8, stack is now {0: 3}