Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

binary-search-js-sarkar

jyotirmaysarkar132ISC1.0.1

A lightweight, zero-dependency JavaScript utility that performs fast and efficient binary search on sorted arrays.

readme

🔍 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

  1. Import the function const binarySearch = require('binary-search-js-sarkar');

  2. 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.