/* Return first occurrence of member from array.
326965
function _removeArrayMember(arr, elem) {
		// TODO: use Array.indexOf for IE >= 9
		var i;
		for (i = arr.length - 1; i >= 0; i--) {
			if (arr[i] === elem) {
				arr.splice(i, 1);
				return true;
			}
		}
		return false;
	}
1092116
function find(array, exp) {
  return (isArray(array) && isDefined(exp))
    //return the member and not an array like `first`
    ? findInArray(array, $parse(exp), false)
    : array;
}
1220285
public function first()
    {
        if (!empty($this->data)) {
            if (Collection::count($this->data) > 0) {
                return $this->data[0];
            } else {
                return;
            }
        } else {
            return;
        }
    }
85642
@SuppressWarnings("unchecked")
	public static <T> T firstNonNull(T... array) {
		if (isNotEmpty(array)) {
			for (final T val : array) {
				if (null != val) {
					return val;
				}
			}
		}
		return null;
	}
141848
function getMembers(index) {
  if (this._members === undefined) {
    this._members = _(getValue(this, 'member') || getValue(this, 'memberOf'))
      .split(/,\s*/)
      .compact()
      .sort(util.compareNatural)
      .value();
  }
  var result = this._members;
  return index === undefined ? result : result[index];
}
365244
function arrayEach$1(array, iteratee) {
  var index = -1,
      length = array == null ? 0 : array.length;

  while (++index < length) {
    if (iteratee(array[index], index, array) === false) {
      break;
    }
  }
  return array;
}
1078167
function findIndex(array, exp) {
  return (isArray(array) && isDefined(exp))
    //return the the index of the member
    ? findInArray(array, $parse(exp), true)
    : array;
}
76876
public static <T> T getFirst(T array[]){
        return array!=null && array.length>0 ? array[0] : null;
    }
785937
public T removeFirst() {
		if (isEmpty()) {
			return null;
		}
		T firstElement = elements[firstIndex];
		elements[firstIndex] = null;
		firstIndex = incrementIndex(firstIndex, 0);
		return firstElement;
	}
703038
function sharedStart (array) {
  var sorted = array.concat().sort()
  var first = sorted[0]
  var last = sorted[sorted.length - 1]
  var len = first.length
  var i = 0
  while (i < len && first.charAt(i) === last.charAt(i)) i++
  return first.substring(0, i)
}
916669
public function first()
    {
        $results = $this->filter('', '', '', ['$top'=> 1]);
        $result = is_array($results) && count($results) > 0 ? $results[0] : null;

        return $result;
    }
800596
function(a) {
		if (!Array.isArray(a)) { return []; }

		return a.filter(function(item, index) {
			// Is this the first location of item
			return a.indexOf(item) === index;
		});
	}
719111
function findFirstProp(objs, p) {
  for (let obj of objs) {
    if (obj && obj.hasOwnProperty(p)) { return valueize(obj[p]); }
  }
}
862030
function findFirstNot(arr, obj, config) {
    var fn = _createIteratorNotFn(obj, config);
    return _findFirst(arr, fn);
}
1071561
public static <E> Optional<E> maybeFirst(E[] array) {
        return new MaybeFirstElement<E>().apply(new ArrayIterator<>(array));
    }
1164876
function findLastIndex(array, exp) {

  if(!isArray(array) || isUndefined(exp)) {
    return array;
  }
  //return the the index of the last member
  var index = (array.length - 1) - findInArray(reverse(array), $parse(exp), true);
  //if it's a NaN
  return index === index ? index : -1;
}
1010960
function removeFirstNot(arr, obj, config) {
    var fn = _createIteratorNotFn(obj, config);
    return _removeFirst(arr, fn);
}