Sha256: 31c891f3d0a25c99a75fff28305825a9bde7cad5b6631625c741ba29bd19bd5e

Contents?: true

Size: 1007 Bytes

Versions: 265

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

265 entries across 263 versions & 29 rubygems

Version Path
trusty-cms-4.3 node_modules/lodash/concat.js
sumomo-0.8.10 data/sumomo/api_modules/node_modules/lodash/concat.js
boring_generators-0.10.0 tmp/templates/app_template/node_modules/lodash/concat.js
trusty-cms-4.2.3 node_modules/lodash/concat.js
boring_generators-0.9.0 tmp/templates/app_template/node_modules/lodash/concat.js
tang-0.2.1 spec/tang_app/node_modules/lodash/concat.js
trusty-cms-4.2.2 node_modules/lodash/concat.js
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/lodash/concat.js
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/lodash/concat.js
ruby2js-4.0.4 lib/tasks/testrails/node_modules/lodash/concat.js
ruby2js-4.0.3 lib/tasks/testrails/node_modules/lodash/concat.js
boring_generators-0.8.0 tmp/templates/app_template/node_modules/lodash/concat.js
boring_generators-0.7.0 tmp/templates/app_template/node_modules/lodash/concat.js
trusty-cms-4.2.1 node_modules/lodash/concat.js
trusty-cms-4.2 node_modules/lodash/concat.js
trusty-cms-4.1.9 node_modules/lodash/concat.js
boring_generators-0.6.0 tmp/templates/app_template/node_modules/lodash/concat.js
trusty-cms-4.1.8 node_modules/lodash/concat.js
boring_generators-0.5.0 tmp/templates/app_template/node_modules/lodash/concat.js
tang-0.2.0 spec/tang_app/node_modules/lodash/concat.js