Comparer<T> Interface
Package: @esfx/equatable
Represents an object that can be used to perform a relational comparison between two values.
Declaration
export interface Comparer<T>
Methods
compare(x, y)
Compares two values, returning a value indicating one of the following conditions:
- A negative value indicates
x
is lesser thany
. - A positive value indicates
x
is greater thany
. - A zero value indicates
x
andy
are equivalent.
Declaration
compare(x: T, y: T): number;
Parameters
- x
- T
The first value to compare.
- y
- T
The second value to compare.
Returns
A number indicating the relational comparison result.