javascript-collections-framework
    Preparing search index...

    Variable hashCodeSymbolConst

    hashCodeSymbol: unique symbol = ...

    The key of the method by which an object returns its hash for value equality.

    a[hashCodeSymbol](hash) returns a finite number; hash is the caller's hash function, to use for nested values. Equal objects (by equalsSymbol) must return the same number. The key is Symbol.for('javascript-collections-framework.hashCode') and does not change between major versions.

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

    class Point {
    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)
    }
    }