javascript-collections-framework
    Preparing search index...

    Interface TreeSetOptions<E>

    Options for a TreeSet.

    const byLength: TreeSetOptions<string> = { comparator: (a, b) => a.length - b.length }
    const words = new TreeSet<string>(byLength)
    interface TreeSetOptions<E> {
        comparator?: Comparator<E>;
    }

    Type Parameters

    • E
    Index
    comparator?: Comparator<E>

    The order of the set; two values are the same member when it returns 0 for them. Natural order (numbers, strings, bigints, booleans, dates or [compareSymbol] objects) when omitted.