Substitute for Scala's Array.concat()
557535
public static byte[] concat(byte[]... arrays) {
		int size = 0;
		for (byte[] a: arrays) {
			size += a.length;
		}
		byte[] result = new byte[size];
		int index = 0;
		for (byte[] a: arrays) {
			System.arraycopy(a, 0, result, index, a.length);
			index += a.length;
		}
		return result;
	}
863129
function(object, options) {
		var i, r = [];
		for (i in object) {
			if (object.hasOwnProperty(i)) {
				r = r.concat(options.fn(object[i]));
			}
		}
		return r;
	}
654567
def concat(cls, variables, dim='concat_dim', positions=None,
               shortcut=False):
        
        if not isinstance(dim, str):
            dim, = dim.dims

        variables = list(variables)
        first_var = variables[0]

        if any(not isinstance(v, cls) for v in variables):
            raise TypeError('IndexVariable.concat requires that all input '
                            'variables be IndexVariable objects')

        indexes = [v._data.array for v in variables]

        if not indexes:
            data = []
        else:
            data = indexes[0].append(indexes[1:])

            if positions is not None:
                indices = nputils.inverse_permutation(
                    np.concatenate(positions))
                data = data.take(indices)

        attrs = OrderedDict(first_var.attrs)
        if not shortcut:
            for var in variables:
                if var.dims != first_var.dims:
                    raise ValueError('inconsistent dimensions')
                utils.remove_incompatible_items(attrs, var.attrs)

        return cls(first_var.dims, data, attrs)
226257
public static <T extends Object> T[] concatenate (T[] v1, T[] v2)
    {
        @SuppressWarnings("unchecked")
        T[] values = (T[])Array.newInstance(v1.getClass().getComponentType(),
            v1.length + v2.length);
        System.arraycopy(v1, 0, values, 0, v1.length);
        System.arraycopy(v2, 0, values, v1.length, v2.length);
        return values;
    }
261275
public static Object concat(Object[] arrs)
    {
        int   totalLen            = 0;
        Class commonComponentType = null;
        for (int i = 0, len = arrs.length; i < len; i++)
        {
            // skip all null arrays
            if (arrs[i] == null)
            {
                continue;
            }

            int arrayLen = Array.getLength(arrs[i]);

            // skip all empty arrays
            if (arrayLen == 0)
            {
                continue;
            }

            totalLen += arrayLen;

            Class componentType = arrs[i].getClass().getComponentType();
            commonComponentType =
                (commonComponentType == null) ? componentType
                                              : commonClass(commonComponentType, componentType);
        }

        if (commonComponentType == null)
        {
            return null;
        }

        return concat(Array.newInstance(commonComponentType, totalLen), totalLen, arrs);
    }
893777
function makeArray(obj) {
        var isArray;
        if ((isArray = Array.isArray)) {
            return isArray(obj) ? obj : [obj];
        }
        return ArrayPrototype.concat(obj);
    }
1277325
function insert(arr, index, values) {
  [].splice.apply(arr, [index, 0].concat(values));
}
1088868
function _concat(a, b, mutate) {
	var aHeight = a.height;
	var bHeight = b.height;

	if (aHeight === 0 && bHeight === 0) {
		return [a, b];
	}

	if (aHeight !== 1 || bHeight !== 1) {
		if (aHeight === bHeight) {
			a = (0, _util.nodeCopy)(a, mutate);
			b = (0, _util.nodeCopy)(b, mutate);
			let tuple = _concat((0, _util.last)(a), (0, _util.first)(b), mutate);
			let a0 = tuple[0];
			let b0 = tuple[1];
			insertRight(a, a0);
			insertLeft(b, b0);
		} else if (aHeight > bHeight) {
			a = (0, _util.nodeCopy)(a, mutate);
			let tuple = _concat((0, _util.last)(a), b, mutate);
			let a0 = tuple[0];
			let b0 = tuple[1];
			insertRight(a, a0);
			b = (0, _util.parentise)(b0, b0.height + 1);
		} else {
			b = (0, _util.nodeCopy)(b, mutate);
			var tuple = _concat(a, (0, _util.first)(b), mutate);
			var left = tuple[0].length === 0 ? 0 : 1;
			var right = left === 0 ? 1 : 0;
			insertLeft(b, tuple[left]);
			a = (0, _util.parentise)(tuple[right], tuple[right].height + 1);
		}
	}

	// Check if balancing is needed and return based on that.
	if (a.length === 0 || b.length === 0) {
		return [a, b];
	}

	var toRemove = calcToRemove(a, b);
	if (toRemove <= _const.E) {
		return [a, b];
	}
	return shuffle(a, b, toRemove);
}
730613
function concat(list, totalLength) {
  if (list.length === 0) return EMPTY_BUFFER;
  if (list.length === 1) return list[0];

  const target = Buffer.allocUnsafe(totalLength);
  let offset = 0;

  for (let i = 0; i < list.length; i++) {
    const buf = list[i];
    buf.copy(target, offset);
    offset += buf.length;
  }

  return target;
}
432314
public static String concat(String[] array, String separator, int fromIndex, int toIndex) {
    StringBuilder buf = new StringBuilder();
    for (int i = fromIndex; i <= toIndex; i++) {
      if (buf.length() > 0)
        buf.append(separator);
      buf.append(array[i]);
    }
    return buf.toString();
  }
942413
function concatArrayFields(properties, fields){
  let arr = [];
  fields.forEach(field => {
    if (Array.isArray(properties[field]) && properties[field].length) {
      arr = arr.concat(properties[field]);
    }
  });
  // dedupe array
  return arr.filter((item, pos, self) => self.indexOf(item) === pos);
}
1153419
function isConcattedArray(node) {
  return node.TYPE === 'Call' && node.expression.TYPE === 'Dot' &&
    node.expression.property === 'concat' && node.expression.expression.TYPE === 'Array' &&
    node.args.length === 1 && node.args[0].TYPE === 'Array';
}
318597
public static String[] concat(String[] ...aa) {
    int l = 0;
    for (String[] a : aa) l += a.length;
    String[] r = new String[l];
    l = 0;
    for (String[] a : aa) {
      System.arraycopy(a, 0, r, l, a.length);
      l += a.length;
    }
    return r;
  }
350641
function mixImmutable()
{
  var args = Array.prototype.slice.apply(arguments);
  return append.apply(null, [{}].concat(args));
}
1116664
private static String js_concat(String target, Object[] args) {
        int N = args.length;
        if (N == 0) { return target; }
        else if (N == 1) {
            String arg = ScriptRuntime.toString(args[0]);
            return target.concat(arg);
        }

        // Find total capacity for the final string to avoid unnecessary
        // re-allocations in StringBuilder
        int size = target.length();
        String[] argsAsStrings = new String[N];
        for (int i = 0; i != N; ++i) {
            String s = ScriptRuntime.toString(args[i]);
            argsAsStrings[i] = s;
            size += s.length();
        }

        StringBuilder result = new StringBuilder(size);
        result.append(target);
        for (int i = 0; i != N; ++i) {
            result.append(argsAsStrings[i]);
        }
        return result.toString();
    }
1181385
public static short[] concatArrays(short[] array, short[]... arrays) {
        short[] res = array;
        for (short[] ele : arrays) {
            res = org.apache.commons.lang3.ArrayUtils.addAll(res, ele);
        }
        return res;
    }
450564
public static byte[] concat(Bytes... listOfBytes) {
    int offset = 0;
    int size = 0;

    for (Bytes b : listOfBytes) {
      size += b.length() + checkVlen(b.length());
    }

    byte[] data = new byte[size];
    for (Bytes b : listOfBytes) {
      offset = writeVint(data, offset, b.length());
      b.copyTo(0, b.length(), data, offset);
      offset += b.length();
    }
    return data;
  }