1
var MyStack = function () {9
MyStack.prototype.push = function (x) {16
MyStack.prototype.pop = function () {17
return this.stack.splice([this.stack.length - 1], 1);23
MyStack.prototype.top = function () {24
return this.stack[this.stack.length - 1];30
MyStack.prototype.empty = function () {31
return this.stack.length === 0 ? true : false;35
* Your MyStack object will be instantiated and called as such:36
* var obj = new MyStack()38
* var param_2 = obj.pop()39
* var param_3 = obj.top()40
* var param_4 = obj.empty()