Interface representing a comparable object.

interface Comparable<T> {
    compareTo(other: T): number;
}

Type Parameters

  • T

Methods

Methods

  • Compares this object with the specified object for order.

    Parameters

    • other: T

      The object to be compared.

    Returns number

    A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.