Function compareString

  • Alpha numeric comparator function (ascending)

    Parameters

    • a: string

      first value to compare

    • b: string

      second value to compare

    Returns number

    A number indicating whether a reference string comes before or after or is the same as the given string in sort order.

    Example

    compareString("apple", "banana");;
    //=> -1
    compareString("banana", "apple");;
    //=> 1
    compareString("apple", "apple");;
    //=> 0

Generated using TypeDoc