egonSchiele / grokking_algorithms

Code for the book Grokking Algorithms (https://amzn.to/29rVyHf)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JavaScript/ES6 solution has formatting problems and non-working example

Alexandrshy opened this issue · comments

  1. The solution in the 01_binary_search.js file has several problems in its implementation (for example, unnecessary use while), and this solution doesn't work for all cases (for example, binarySearch([1,2,3,4,5,6,7,8,9,10], 3) return null);
  2. For formatting JavaScript code is better to use Prettier. This will help in all examples to make the same formatting and it will look better.

As I read the book, I can create issues and fix them for JavaScript/ES6 code examples.

I fixed it here #127