Locates the insertion point for target in sorted_arr to maintain sorted order.
If target is already present, the insertion point is to the right of any existing entries.
Parameters
sorted_arr: (number|bigint)[]
The sorted array to search. Must be sorted in ascending order.
target: number
The value to locate.
Returns number
The index where target should be inserted.
Remarks
The time complexity is O(log n).
If the array is not sorted, the result is undefined.
Locates the insertion point for
targetinsorted_arrto maintain sorted order. Iftargetis already present, the insertion point is to the right of any existing entries.