API Reference > bentleyjs-core > Collections > PriorityQueue > constructor constructor Method Constructor PriorityQueue(compare: OrderedComparator<T>, clone: CloneFunction<T> = shallowClone): PriorityQueue note If the criterion which control the result of the compare function changes, then PriorityQueue.sort should be used to reorder the queue according to the new criterion. Parameter Type Description compare OrderedComparator<T> The function used to compare values in the queue. If compare(x, y) returns a negative value, then x is placed before y in the queue. clone CloneFunction<T> The function used to clone a value for insertion onto the queue. The default implementation simply returns its input. Returns - PriorityQueue Defined in core/bentley/src/PriorityQueue.ts Line 23 Last Updated: 13 June, 2024