ValueObject

The interface to fulfill to qualify as a Value Object.

Members

True if this and the other Collection have value equality, as defined by Immutable.is().

Method signature

equals(other: unknown): boolean;

Note: This is equivalent to Immutable.is(this, other), but provided to allow for chained expressions.

Computes and returns the hashed identity for this Collection.

Method signature

hashCode(): number;

The hashCode of a Collection is used to determine potential equality, and is used when adding this to a Set or as a key in a Map, enabling lookup via a different instance.

Note: hashCode() MUST return a Uint32 number. The easiest way to guarantee this is to return myHash | 0 from a custom implementation.

If two values have the same hashCode, they are not guaranteed to be equal. If two values have different hashCodes, they must not be equal.

Note: hashCode() is not guaranteed to always be called before equals(). Most but not all Immutable.js collections use hash codes to organize their internal data structures, while all Immutable.js collections use equality during lookups.

;