Returned expression results in new array with all occurrences of value removed.
779147
public static Expression arrayRemove(JsonArray array, Expression value) {
        return arrayRemove(x(array), value);
    }
993957
public static Expression arrayContains(String expression, Expression value) {
        return arrayContains(x(expression), value);
    }
242202
public static String[] removeEmpties(final String... values) {
		if (values == null || values.length == 0){
			return new String[0];
		}
		List<String> validValues = new ArrayList<String>();
		for (String value : values){
			if (value != null && value.length() > 0){
				validValues.add(value);
			}
		}
		return validValues.toArray(new String[validValues.size()]);
	}
673590
function removeUnusedAssignmentExpressions (ast) {
  var unused = findUnusedAssignmentExpressions(ast);
  traverse.traverse(ast, {
    enter: function (node, parent) {
      if (node.type !== 'BlockStatement') {
        return;
      }
      node.body = fast.filter(node.body, function (item) {
        return !~fast.indexOf(unused, item);
      });
    }
  });
  return ast;
}
1009241
private static List<Expression> removeDuplicates(List<Expression> expressions)
    {
        Set<Expression> seen = new HashSet<>();

        ImmutableList.Builder<Expression> result = ImmutableList.builder();
        for (Expression expression : expressions) {
            if (!DeterminismEvaluator.isDeterministic(expression)) {
                result.add(expression);
            }
            else if (!seen.contains(expression)) {
                result.add(expression);
                seen.add(expression);
            }
        }

        return result.build();
    }
533889
function removeDuplicates(arr) {
    if (isArray(arr)) {
        return reduce(arr, function (a, b) {
            if (indexOf(a, b) === -1) {
                return a.concat(b);
            } else {
                return a;
            }
        }, []);
    }
}
732320
public static Expression arrayPosition(String expression, Expression value) {
        return arrayPosition(x(expression), value);
    }
699627
private static Node asDetachedExpression(Node expr) {
    switch (expr.getToken()) {
      case SPREAD:
        expr = IR.arraylit(expr.detach()).srcref(expr);
        break;
      default:
        break;
    }

    if (expr.getParent() != null) {
      expr.detach();
    }

    checkState(IR.mayBeExpression(expr), expr);
    return expr;
  }
1365261
function omit(array, exp) {

  if(!isArray(array) || isUndefined(exp)) {
    return array;
  }

  return array.filter(function(elm) {
    return (isObject(elm) || isFunction(exp))
      ? !$parse(exp)(elm)
      : elm !== exp;
  });
}
448052
public static Expression arrayReplace(Expression expression, Expression value1, Expression value2, long n) {
        return x("ARRAY_REPLACE(" + expression.toString() + ", " + value1 + ", " + value2 + ", " + n + ")");
    }
949135
function removeDuplicates(items) {
    var temp = {}, result = [], x, i = items.length;
    while (i--) {
      x = getData(items[i], 'id', true);
      if (!temp.hasOwnProperty(x)) {
        temp[x] = 1;
        result.push(items[i]);
      }
    }
    return result;
  }
713905
private int removeOrRetain(Collection<?> collection, boolean retain, int from, int to) {
        for (int i = from; i < to; i++) {
            if (collection.contains(elements[i]) == retain) {
                continue;
            }

            /*
             * We've encountered an element that must be removed! Create a new
             * array and copy in the surviving elements one by one.
             */
            Object[] newElements = new Object[elements.length - 1];
            System.arraycopy(elements, 0, newElements, 0, i);
            int newSize = i;
            for (int j = i + 1; j < to; j++) {
                if (collection.contains(elements[j]) == retain) {
                    newElements[newSize++] = elements[j];
                }
            }

            /*
             * Copy the elements after 'to'. This is only useful for sub lists,
             * where 'to' will be less than elements.length.
             */
            System.arraycopy(elements, to, newElements, newSize, elements.length - to);
            newSize += (elements.length - to);

            if (newSize < newElements.length) {
                newElements = Arrays.copyOfRange(newElements, 0, newSize); // trim to size
            }
            int removed = elements.length - newElements.length;
            elements = newElements;
            return removed;
        }

        // we made it all the way through the loop without making any changes
        return 0;
    }
678581
@Override
	public Expression[] retractExpressions() {
		return new Expression[] {existDefaultValue ? cast(operand(2),
				typeLiteral(getResultType())) : literal(null, getResultType())};
	}
170354
function () {
                var e, expressions = [];

                do {
                    e = this.expression();
                    if (e) {
                        expressions.push(e);
                        if (! $char(',')) { break; }
                    }
                } while(e);

                if (expressions.length > 0) {
                    return new(tree.Value)(expressions);
                }
            }
651759
private ExpressionContext findAndRemoveValue(List<NamedValueContext> namedValues, String name) {
    
    Iterator<NamedValueContext> namedValueIter = namedValues.iterator();
    while (namedValueIter.hasNext()) {
      NamedValueContext namedValue = namedValueIter.next();
      if (name.equals(value(namedValue.name))) {
        namedValueIter.remove();
        return namedValue.expr;
      }
    }

    return null;
  }
211355
@SuppressWarnings("unchecked")
  public static <T> T[] removeValues(T[] values, Predicate<T> shouldRemove, Class<T> type) {
    Collection<T> collection = new ArrayList<>(values.length);
    for (T value : values) {
      if (shouldRemove.negate().test(value)) {
        collection.add(value);
      }
    }
    T[] array = (T[]) Array.newInstance(type, collection.size());
    return collection.toArray(array);
  }
250319
protected function filterOutArrayValues($values = null, \Closure $filter = null, $preserveKeys = false)
    {
        $data = [];

        if (is_array($values) && count($values))
        {
            foreach ($values as $key => $value)
            {
                $value = trim($value);

                if (!empty($value))
                {
                    if (is_callable($filter) && $filter($value))
                    {
                        $data[$key] = $value;
                    }
                }
            }

            if (!$preserveKeys)
            {
                $data = array_values($data);
            }
        }

        return $data;
    }