Comparator: (a: T, b: T) => number

Comparators compare two objects.

Type Parameters

  • T

Type declaration

    • (a: T, b: T): number
    • Parameters

      • a: T

        first object to compare

      • b: T

        second object to compare

      Returns number

      Returns < 0 if a < b, > 0 if a > b and 0 if a == b.