A simple npm library to make binary search with javascript
$ npm install binarysjs
# $ yarn add binarysjs const { getIndex } = require('binarysjs');
const index = getIndex(target, array, startIndex?, endIndex?)
// target = The value you want to find
// array = The array you want to search in
// startIndex && endIndex = optional parameters you don't want to check the whole array- Any number bigger than or equal to zero: Found value index
- -1: Value not found
- Node.js
- Typescript
- Jest
This project is under the MIT license. See the LICENSE for more information.
Made with