Sha256: 31c891f3d0a25c99a75fff28305825a9bde7cad5b6631625c741ba29bd19bd5e

Contents?: true

Size: 1007 Bytes

Versions: 264

Compression:

Stored size: 1007 Bytes

Contents

var arrayPush = require('./_arrayPush'),
    baseFlatten = require('./_baseFlatten'),
    copyArray = require('./_copyArray'),
    isArray = require('./isArray');

/**
 * Creates a new array concatenating `array` with any additional arrays
 * and/or values.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Array
 * @param {Array} array The array to concatenate.
 * @param {...*} [values] The values to concatenate.
 * @returns {Array} Returns the new concatenated array.
 * @example
 *
 * var array = [1];
 * var other = _.concat(array, 2, [3], [[4]]);
 *
 * console.log(other);
 * // => [1, 2, 3, [4]]
 *
 * console.log(array);
 * // => [1]
 */
function concat() {
  var length = arguments.length;
  if (!length) {
    return [];
  }
  var args = Array(length - 1),
      array = arguments[0],
      index = length;

  while (index--) {
    args[index - 1] = arguments[index];
  }
  return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
}

module.exports = concat;

Version data entries

264 entries across 262 versions & 29 rubygems

Version Path
appmap-0.71.0 ./node_modules/lodash/concat.js
disco_app-0.16.1 test/dummy/node_modules/lodash/concat.js
appmap-0.70.2 ./node_modules/lodash/concat.js
sumomo-0.8.14 data/sumomo/api_modules/node_modules/lodash/concat.js
appmap-0.70.1 ./node_modules/lodash/concat.js
appmap-0.70.0 ./node_modules/lodash/concat.js
appmap-0.69.0 ./node_modules/lodash/concat.js
sumomo-0.8.13 data/sumomo/api_modules/node_modules/lodash/concat.js
appmap-0.68.2 ./node_modules/lodash/concat.js
appmap-0.68.1 ./node_modules/lodash/concat.js
disco_app-0.15.2 test/dummy/node_modules/lodash/concat.js
appmap-0.68.0 ./node_modules/lodash/concat.js
appmap-0.67.1 ./node_modules/lodash/concat.js
trusty-cms-5.0.3 node_modules/lodash/concat.js
trusty-cms-5.0.2 node_modules/lodash/concat.js
appmap-0.67.0 ./node_modules/lodash/concat.js
disco_app-0.18.4 test/dummy/node_modules/lodash/concat.js
disco_app-0.18.1 test/dummy/node_modules/lodash/concat.js
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/lodash/concat.js
disco_app-0.14.0 test/dummy/node_modules/lodash/concat.js