bsc
Binary search with comparator.
- tests not only for the result but for how many steps it takes as well
- always return
-1
if nothing has been found, no "insertion point" negative values - no "lower" or "upper bounds"
Install
$ yarn add bsc
Usage
number
const arr = 0 1 2 3 4 5 6 7 8 9 // if comparator return `0` then that item is the result index // 2 // -1