binary search (js)