peek() { return this.elements[this.head]; } //if you find this answer is useful , //upvote ⇑⇑ , so can the others benefit also . @mohammad alshraideh ( ͡~ ͜ʖ ͡°)