Type Alias Comparator<A, B>

Comparator<A, B>: ((a: A, b: B) => number)

A function that can be used as a comparator for sorting. Return > 0 if a is greater than b Return = 0 if a equals b Return < 0 if a is less than `b

Type Parameters

  • A
  • B = A