docs: function (key, array, index, fnCompare) {
          
          if (typeof key === 'undefined')
              throw "IllegalArgumentException: a valid key must be provided (indexSearch).";
          
          if (!(array instanceof Array))
              throw "IllegalArgumentException: array must be of type Array.";
          
          var len = array.length;
          if (len === 0)
              return -1;
          
          // Arrays._arrayItemFinder() validates "index" argument.
          var itemFinder = Arrays._arrayItemFinder(index);
          
          fnCompare = Arrays._selectCompare(fnCompare, key);
      
          var min  = 0,
              max  = len - 1,
              item = itemFinder(array, min),
              dir  = fnCompare(item, key);
          
          if (dir > 0)  // If the first item is bigger than "key", we won't find anything.
              return -1;
          else if (dir === 0)
              return min;
          
          if (len === 1)
              return -1;
          
          item = itemFinder(array, max);
          dir  = fnCompare(item, key);
          if (dir < 0)  // If the last item is smaller than "key", we won't find anything.
              return -1;
          else if (dir === 0)
              return max;
          
          if (len === 2)
              return -1;
          
          var foundAt = -1,
              loop    = true,
              pos;
          while (foundAt < 0 && loop === true) {
              pos = Math.floor((min + max) / 2);
              if (pos === min)    // we're done.
                  loop = false;
              else {
                  item = itemFinder(array, pos);
                  dir  = fnCompare(item, key);
                  
                  if (dir === 0)
                      foundAt = pos;
                  else if (dir < 0)
                      min = pos;
                  else
                      max = pos;
              }
          }
          
          return foundAt;
      }