DEFINE A STACK DATA STRUCTURE USING JAVASCRIPT WITH THE FOLLOWING MEMBERS
const stack = new Stack()
stack.push(item)
stack.pop()
stack.count()
stack.peek() // Read the top item
CONDITIONS:
- count should not be an instance member
- push, pop, peek methods should be prototype members
- Do the proper error handling
ANSWER:
npm run run:challenge1
UNIT TEST
npm run test:challenge1