- Read the "Challenge description" below.
- Make changes to the challenge.js file.
- Commit your changes.
- Wait for the result of the "GitHub Classroom Workflow" action. If it is green - congratulations, you solved this challenge! If not - try again!
- You can watch an example of how to solve a challenge in the video linked in the corresponding lesson.
Create a Stack with two methods push and pop. You can use your LinkedList class to keep track of the elements internally (altough it is not a must-have).
Example
This is an example of a test case:
const stack = new Stack()
stack.push(3)
stack.push(5)
console.log(stack.pop())
// => 5
stack.push(2)
stack.push(7)
console.log(stack.pop())
// => 7
console.log(stack.pop())
// => 2
console.log(stack.pop())
// => 3
If you cannot see any auto-grading workflows on the Actions page, learn how to fix it in this repo.