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
trusty-cms-6.3.1 node_modules/lodash/concat.js
immosquare-cleaner-0.1.51 node_modules/lodash/concat.js
boring_generators-0.15.0 tmp/templates/app_template/node_modules/lodash/concat.js
clapton-0.0.26 lib/clapton/javascripts/node_modules/lodash/concat.js
clapton-0.0.25 lib/clapton/javascripts/node_modules/lodash/concat.js
immosquare-cleaner-0.1.50 node_modules/lodash/concat.js
clapton-0.0.24 lib/clapton/javascripts/node_modules/lodash/concat.js
clapton-0.0.23 lib/clapton/javascripts/node_modules/lodash/concat.js
clapton-0.0.22 lib/clapton/javascripts/node_modules/lodash/concat.js
clapton-0.0.21 lib/clapton/javascripts/node_modules/lodash/concat.js
clapton-0.0.20 lib/clapton/javascripts/node_modules/lodash/concat.js
clapton-0.0.19 lib/clapton/javascripts/node_modules/lodash/concat.js
clapton-0.0.18 lib/clapton/javascripts/node_modules/lodash/concat.js
clapton-0.0.17 lib/clapton/javascripts/node_modules/lodash/concat.js
clapton-0.0.16 lib/clapton/javascripts/node_modules/lodash/concat.js
clapton-0.0.15 lib/clapton/javascripts/node_modules/lodash/concat.js
immosquare-cleaner-0.1.49 node_modules/lodash/concat.js
clapton-0.0.14 lib/clapton/javascripts/node_modules/lodash/concat.js
immosquare-cleaner-0.1.48 node_modules/lodash/concat.js
clapton-0.0.13 lib/clapton/javascripts/node_modules/lodash/concat.js