JavaScript Easy to Understand ES6 class solution
\nclass MinStack {\n    constructor() {\n        this.stack = [];\n        this.min = Infinity;\n    }\n    push(x) {\n        const valMinPair = {val: x, prevM
```\nclass MinStack {\n    constructor() {\n        this.stack = [];\n        this.min = Infinity;\n    }\n    push(x) {\n        const valMinPair = {val: x, prevMin: this.min};\n        this.stack.push(valMinPair);\n        this.min = Math.min(this.min, x);\n    }\n    pop() {\n        const {val, prevMin} = this.stack.pop();\n        this.min = prevMin;\n        return val;\n    }\n    top() {\n        return this.stack[this.stack.length - 1].val;\n    }\n    getMin() {\n        return this.min;\n    }\n}\n\n```
['JavaScript']