Equaler<T> Interface
Package: @esfx/equatable
Represents an object that can be used to compare the equality of two values.
Declaration
export interface Equaler<T>
Methods
equals(x, y)
Tests whether two values are equal to each other.
Declaration
equals(x: T, y: T): boolean;
Parameters
- x
- T
The first value.
- y
- T
The second value.
Returns
true
if the values are equal; otherwise, false
.
hash(x)
Generates a hash code for a value.
Declaration
hash(x: T): number;
Parameters
- x
- T
The value to hash.
Returns
The numeric hash-code for the value.