1、首先封装一个栈
//封装栈类
function Stack() {
this.items = []
//栈的相关操作
//1、将元素压入栈
Stack.prototype.push = function (element) {
this.items.push(element)
}
//2、将元素出栈
Stack.prototype.pop = function () {
return this.items.pop()
}
//3、查看栈顶元素
Stack.prototype.peek = function () {
return this.items[this.items.</