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
@functionname tobinarySearch(matching the exported function). - Reorders/clarifies
@paramentries to match the actual parameter order and markslow/highas optional with defaults. - Adds usage
@exampleblocks for both found and not-found cases.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.