Function findInsertIndex

  • Find the insert index for the given key in a sorted array.

    Parameters

    • sorted: unknown[]

      The sorted array to search

    • item: unknown

      The search key

    • comparator: Comparator<unknown> = compare

      Optional custom compare function

    Returns number