format
typescript
Queue.Peek()class: Queue
description
Get the element at the front of the queue without removing it.
parameter
| param_name | type | description |
|---|
reture
| type | description |
|---|---|
T|undefined | The 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);