Binary Search List Leetcode Javascript Question