Skip to content

tyneq


tyneq / Comparer

Type Alias: Comparer()<T>

Comparer<T> = (a, b) => number

Defined in: src/types/core.ts:52

A function that compares two values for ordering.

Type Parameters

Type ParameterDescription
TThe type of values being compared.

Parameters

ParameterType
aT
bT

Returns

number

Remarks

Must return a negative number when a < b, a positive number when a > b, and 0 when equal. Matches the signature expected by Array.prototype.sort.