code: function arrayContainsBefore(array, element, index, keyFn) {
      var i = -1;
  
      if (keyFn) {
        keyFn = createCallback(keyFn);
        while (++i < index) {
          if (keyFn(array[i]) === keyFn(element)) {
            return true;
          }
        }
  
      } else {
        while (++i < index) {
          if (array[i] === element) {
            return true;
          }
        }
      }
  
      return false;
    }
docs: Checks if an element exists in an array before a given index.
  
  @private
  @param {Array} array
  @param {*} element
  @param {number} index
  @param {Function} keyFn
  @returns {boolean}
  
  @examples
  arrayContainsBefore([1, 2, 3], 3, 2) // => false
  arrayContainsBefore([1, 2, 3], 3, 3) // => true