摘要: 上篇博客介绍了基于数组创建一个栈,这是用对象创建一个栈 s1.声明一个Stack类 class Stack { constructor() { this.count = 0; this.items = {}; } } 在构造器中定义count属性用来记录栈的大小 s2.push()方法,向栈内添加元 阅读全文