https://www.khanacademy.org/computing/computer-science/algorithms/binary-search/p/challenge-binary-search
I was following the pseudo code to implement algorithm on t
If anyone is still looking for the answer, you needed to make it (max >= min)
while (max >= min) { guess = Math.floor((max + min) / 2); if (array[guess] === targetValue) { return guess; } else if (array[guess] < targetValue) { min = guess + 1; } else { max = guess - 1; } } return -1;