Open jsartisan opened 3 months ago
index.js
class Stack { constructor() { this.items = []; } size() { return this.items.length; } peek() { return this.items.at(-1); } push(item) { return this.items.push(item); } pop() { return this.items.pop(); } isEmpty() { return this.size() === 0; } } export { Stack };
index.js