code: function getRank (array, elem) {
    let left = 0;
    let right = array.length - 1;
  
    while (left <= right) {
      const mid = left + Math.floor((right - left) / 2);
      const midElem = array[mid];
  
      if (midElem === elem) {
        return mid;
      } else if (elem < midElem) {
        right = mid - 1;
      } else {
        left = mid + 1;
      }
    }
  
    return left;
  }
docs: Returns the "rank/index" of the element in a sorted array if found or the highest index if not. Uses (binary search)
  @param {Array} array A sorted array to search in
  @param {any} elem the element in the array to search for
  @returns {number} The rank/index of the element in the given array
  @memberof Colors