()
| 24 | |
| 25 | // Removes and returns the value at the end of the stack |
| 26 | pop() { |
| 27 | if (this.top === 0) { |
| 28 | return 'Stack is Empty' |
| 29 | } |
| 30 | |
| 31 | this.top-- |
| 32 | const result = this.stack[this.top] |
| 33 | this.stack = this.stack.splice(0, this.top) |
| 34 | return result |
| 35 | } |
| 36 | |
| 37 | // Returns the size of the stack |
| 38 | size() { |
no outgoing calls
no test coverage detected