javascript-collections-framework
    Preparing search index...

    Interface PriorityQueueOptions<E>

    Options for a PriorityQueue.

    const longestFirst: PriorityQueueOptions<string> = { comparator: (a, b) => b.length - a.length }
    const tasks = new PriorityQueue<string>(longestFirst)
    interface PriorityQueueOptions<E> {
        comparator?: Comparator<E>;
    }

    Type Parameters

    • E
    Index
    comparator?: Comparator<E>

    The order of the queue: poll() returns an element for which no other element compares less. Natural order (numbers, strings, bigints, booleans, dates or [compareSymbol] objects) when omitted.