Function binaryInsertionIndex

  • Binary search

    Type Parameters

    • T

    Parameters

    • arr: T[]
    • compare: ((a) => number)

      Function that should return < 0 if given element is less than searched element etc

        • (a): number
        • Parameters

          Returns number

    Returns number

    The insertion index of the element to look for

    Throws

    TypeError if arr is not an array

    Throws

    whatever compare() throws

Generated using TypeDoc