Skip to content

format

typescript
Queue.Peek()

class: Queue

description

Get the element at the front of the queue without removing it.

parameter

param_nametypedescription

reture

typedescription
T|undefinedThe value of the element at the front of the queue.

code example

typescript
let queue = new Queue<Number>();
for (let index = 0; index < 3; index++) {
    queue.Enqueue(index);
}

let head = queue.Peek();
Debug.Log("Front element of the queue:", head);