MCPcopy Index your code
hub / github.com/TheAlgorithms/JavaScript / peekLast

Method peekLast

Data-Structures/Queue/Queue.js:81–87  ·  view source on GitHub ↗

* @description - Return the item at the tail of the queue * @returns {*}

()

Source from the content-addressed store, hash-verified

79 * @returns {*}
80 */
81 peekLast() {
82 if (this.isEmpty()) {
83 throw new Error('Queue is Empty')
84 }
85
86 return this.tail.data
87 }
88
89 /**
90 * @description - Return the array of Queue

Callers 1

Queue.test.jsFile · 0.80

Calls 1

isEmptyMethod · 0.95

Tested by

no test coverage detected