API Reference > bentleyjs-core > Collections > PriorityQueue > constructor constructor Method Constructor PriorityQueue<T>(compare: OrderedComparator<T, T>, clone: CloneFunction<T> = shallowClone): PriorityQueue<T> 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, 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<T> Defined in core/bentley/src/PriorityQueue.ts Line 31 Last Updated: 12 June, 2024