🔍 binary-search-js-sarkar
A lightweight, zero-dependency JavaScript utility that performs fast and efficient binary search on sorted arrays.
📦 Installation
`
bash
npm install binary-search-js-sarkar
Import the function const binarySearch = require('binary-search-js-sarkar');
Use it on a sorted array
const arr = [1, 3, 5, 7, 9, 11]; const target = 7;
const result = binarySearch(target, arr); console.log(result); // Output: 3 ⚠️ Make sure the array is sorted in ascending order.