* Return the front element without removing it, or `undefined` if the deque * is empty. * * @example Peeking at the front * ```ts * import { Deque } from "@std/data-structures/deque"; * import { assertEquals } from "@std/assert"; * * const deque = new Deque([1, 2, 3]); * a
()
| 432 | * @returns The front element, or `undefined` if empty. |
| 433 | */ |
| 434 | peekFront(): T | undefined { |
| 435 | if (this.#length === 0) return undefined; |
| 436 | return this.#buffer[this.#head]; |
| 437 | } |
| 438 | |
| 439 | /** |
| 440 | * Return the back element without removing it, or `undefined` if the deque |
no outgoing calls
no test coverage detected