◐ Shell
clean mode source ↗

docs: Improve comments and documentation in binary search algorithm by ITZ-NIHALPATEL · Pull Request #1849 · TheAlgorithms/JavaScript

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Documentation-only update to Recursive/BinarySearch.js that revises the JSDoc block to accurately reflect the current function signature and behavior. The previous JSDoc was outdated (wrong function name BinarySearch, listed low/high before searchValue, and didn't note default parameters), so this brings the docs in line with the implementation binarySearch(arr, searchValue, low = 0, high = arr.length - 1).

Changes:

  • Corrects @function name to binarySearch (matching the exported function).
  • Reorders/clarifies @param entries to match the actual parameter order and marks low/high as optional with defaults.
  • Adds usage @example blocks for both found and not-found cases.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.