The array to be searched.
The value to be searched for.
The callback that defines the sort order. If omitted, the array elements are compared using comparison operators.
The maximum index in xs that is searched (exclusive).
The index of the searched value, if it is contained in the array; otherwise, -(insertion point) - 1. The insertion point is defined as the point at which the searched value would be inserted into the array: the index of the first element greater than the searched value, or array length if all elements in the array are less than the specified key. Note that this guarantees that the return value will be ≥ 0 if and only if the searched value is found.
Searches the specified array xs for the specified value x using the binary search algorithm. The array must be sorted into ascending order according to the
comparator
prior to making this call. If it is not sorted, the results are undefined.