javascript-collections-framework
    Preparing search index...

    Variable equalsSymbolConst

    equalsSymbol: unique symbol = ...

    The key of the method by which an object compares itself with another for value equality.

    a[equalsSymbol](b) returns true or false. It is used only when both values implement it, and only together with hashCodeSymbol: equal objects must return the same hash. The key is Symbol.for('javascript-collections-framework.equals') and does not change between major versions.

    Time: O(1) to read; the method's cost is the implementer's.

    class Point implements Equatable {
    constructor(readonly x: number, readonly y: number) {}
    [equalsSymbol](other: unknown): boolean {
    return other instanceof Point && other.x === this.x && other.y === this.y
    }
    [hashCodeSymbol](hash: HashFunction): number {
    return hash(this.x) * 31 + hash(this.y)
    }
    }