MCPcopy Create free account
hub / github.com/betomoedano/JavaScript-Coding-Interview-Questions / pop

Method pop

stacks/queue-via-stacks.js:26–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24 }
25
26 pop() {
27 this.#shiftStacks(); // Ensure stackOldest has the current elements
28 return this.stackOldest.pop();
29 }
30 peek() {
31 this.#shiftStacks(); // Ensure stackOldest has the current elements
32 return this.stackOldest.peek();

Callers

nothing calls this directly

Calls 2

#shiftStacksMethod · 0.95
popMethod · 0.45

Tested by

no test coverage detected