The array in which to search for the target.
The target element to find within the array.
Optional
left: number = 0The left index of the current search range.
Optional
right: number = ...The right index of the current search range.
Configuration object containing:
compareFn
: Comparison function defining the element order.isSorted
: Whether the data array is pre-sorted (defaults to false
).The index of the target in the array, or -1 if the target is not found.
Performs a ternary search on an array with a custom comparison function.
isSorted
isfalse
, the array will first be sorted using TimSort.