The type of elements in the priority queue.
The type of priority associated with each element.
Optional
iterable: Iterable<[T, P], any, any>Optional
capacity: numberReadonly
capacityThe maximum number of elements the collection can hold.
If the collection is unbounded, this will be Infinity
.
Protected
Readonly
dataReadonly
isPredicate function which determine if one priority is higher than another.
Removes all elements from the collection.
Returns the number of elements in the collection.
Removes and returns the item with the highest priority from the priority queue.
The item with the highest priority, or undefined
if the queue is empty.
Returns the item with the highest priority without removing it from the queue.
The item with the highest priority, or undefined
if the queue is empty.
Replaces the first occurence of the item matching the given predicate in the collection with a new item.
true
if the item was found and replaced, false
otherwise.
A priority queue implementation.