javascript-collections-framework
    Preparing search index...

    Interface LinkedHashSetOptions<E>

    Options for a LinkedHashSet. At most one of key and equivalence may be given; with neither, members compare with SameValueZero, as in native Set.

    const byId: LinkedHashSetOptions<{ id: number }> = { key: (user) => user.id }
    const byValue: LinkedHashSetOptions<Point> = { equivalence: valueEquivalence }
    interface LinkedHashSetOptions<E> {
        equivalence?: Equivalence<E>;
        key?: KeyOf<E>;
    }

    Type Parameters

    • E
    Index
    equivalence?: Equivalence<E>

    Decides membership by its equals and hash. valueEquivalence honours the equalsSymbol/hashCodeSymbol protocol; sameValueZeroEquivalence is the default behaviour.

    key?: KeyOf<E>

    Derives the primitive key a member is found by; two values are the same member when their keys are SameValueZero-equal. Called once per value per operation, never again for a stored member.