We will be creating a module that helps us generate a Stack. A stack is a data structure that allows adding and removing elements in a particular order. Everytime an item is added, it goes to the top of the 'stack' Everytime an item is removed, the item on the top of the stack is removed from the datastructure and returned. A stack is a LIFO (last in first out) structure.
Returns the size of the stack
Adds an item to the top of the stack structure
Takes an item off the top of the stack and returns the item.
- Fork this repository and clone it from your personal GitHub Account
- In the Terminal, navigate to the newly created folder for this repository.
- Install dependencies by running the command:
npm install
- Run tests by running the command:
npm test
- Your work will be one in the file named:
lib/Stack.js
- Make your tests pass!