• Inserts the given value into the given array at a sorted location.

    Type Parameters

    • T

    Parameters

    • value: T

      Value to insert

    • array: T[]

      Array to insert into

    • comparator: ((v1, v2) => number)

      Function to use when determining sort order.

        • (v1, v2): number
        • Parameters

          • v1: T
          • v2: T

          Returns number

    • Optional sortDescending: boolean

      Defaults to false; if true, the insertion is sorted in reverse order.

    Returns void