Skip to content
On this page

PriorityQueue<T>.clear

Removes all objects from the PriorityQueue<T>.

Example

typescript
const queue = new PriorityQueue<number>();

queue.enqueue(1);
queue.enqueue(2);
queue.enqueue(3);

queue.length // => 3
queue.clear()
queue.length // => 0