MCPcopy Create free account
hub / github.com/careercup/CtCI-6th-Edition-JavaScript / peek

Method peek

chapter04/util/Stack.js:33–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31 }
32
33 peek() {
34 if (this.isEmpty()) return null;
35 return this._data[this.size() - 1];
36 }
37}
38
39module.exports = Stack;

Callers

nothing calls this directly

Calls 2

isEmptyMethod · 0.95
sizeMethod · 0.95

Tested by

no test coverage detected