UNPKG

@newdash/newdash

Version:

javascript/typescript utility library

19 lines (18 loc) 472 B
/** * This method is like `indexOf` except that it performs a binary * search on a sorted `array`. * * @since 5.11.0 * @category Array * @param array The array to inspect. * @param value The value to search for. * @returns Returns the index of the matched value, else `-1`. * @example * * ```js * sortedIndexOf([4, 5, 5, 5, 6], 5) * // => 1 * ``` */ export declare function sortedIndexOf<T>(array: Array<T>, value: T): number; export default sortedIndexOf;