code: function indexInRange(indices, left, right) {
      if (indices.length === 0) {
          return false
      }
  
      var minIndex = 0
      var maxIndex = indices.length - 1
      var currentIndex
      var currentItem
  
      while (minIndex <= maxIndex) {
          currentIndex = ((maxIndex + minIndex) / 2) >> 0
          currentItem = indices[currentIndex]
  
          if (minIndex === maxIndex) {
              return currentItem >= left && currentItem <= right
          } else if (currentItem < left) {
              minIndex = currentIndex + 1
          } else  if (currentItem > right) {
              maxIndex = currentIndex - 1
          } else {
              return true
          }
      }
  
      return false;
  }
docs: Binary search for an index in the interval [left, right]