Lodash _.concat() Method

Beginner
5 min read
Updated: Nov 2026
5 examples
Array

Definition

Creates a new array concatenating array with any additional arrays and/or values. Array arguments are flattened one level. Added in Lodash 4.0.0. Does not mutate the source.

Pass the required arguments shown below. Lodash Array helpers usually return a new value — check whether the source array is mutated.

Syntax

Call _.concat on an array. Start with this line.

Lodash
_.concat(array, [values])
CallWhat it does
_.concat(array, [values])Primary signature.
_.concat(array)Call with an array argument.

Prefer import concat from "lodash/concat" when you want a smaller bundle.

Library declarations
Lodash
_.concat(array, [values])

Parameters

ParameterDescription
arrayOptional. Starting collection (*omit all args → [])
…valuesOptional. Extra values and/or arrays to append

Return Value

Return ValueDescription
*New concatenated array

Lodash Examples

Example 1 — Official: Mix Values and Arrays

Scalars append as-is; arrays spread one level; nested arrays stay nested.

Lodash
var array = [1];
_.concat(array, 2, [3], [[4]]);
// → [1, 2, 3, [4]]
Try It Yourself

How It Works

  1. Copy. Start from a copy of [1].
  2. Value. Append 2 as a single item.
  3. Array. [3] contributes its element 3.
  4. Nested. [[4]] contributes one element: [4].

Example 2 — Join Two Arrays

Pass a second array to append all of its elements.

Lodash
_.concat(["a", "b"], ["c", "d"]);
// → ["a", "b", "c", "d"]
Try It Yourself

How It Works

  1. Base. Copy ["a","b"].
  2. Second arg. It is an array → append each element.
  3. Result. One flat list of four strings.
  4. Tip. Same idea as [...a, ...b] for arrays.

Example 3 — Append Values Only

Non-array arguments are pushed as single items.

Lodash
_.concat([10], 20, 30);
// → [10, 20, 30]
Try It Yourself

How It Works

  1. Start. Copy [10].
  2. Scalars. 20 and 30 are not arrays → each is one element.
  3. Order. Arguments are appended left to right.
  4. Use. Handy when mixing list data with single extras.

Example 4 — Nested Array Stays Nested

One-level flatten only — deeper nesting is preserved.

Lodash
_.concat([1], [[2, 3]]);
// → [1, [2, 3]]
Try It Yourself

How It Works

  1. Arg. [[2, 3]] is an array with one element.
  2. Spread one level. That element is [2, 3].
  3. Not deep. 2 and 3 are not pulled out further.
  4. Need flat? Follow with _.flatten.

Example 5 — Source Array Unchanged

Concat always returns a new array.

Lodash
var array = [1];
var other = _.concat(array, 2, [3]);

other;  // [1, 2, 3]
array;  // [1]
Try It Yourself

How It Works

  1. Copy first. Lodash copies the starting array before appending.
  2. Build other. Extra args go into the new result only.
  3. Check source. array is still [1].
  4. Safe. Prefer concat over push when you must keep the original.

Browser & Runtime Support

_.concat is a Lodash 4.x Array helper (since 4.0.0). It runs anywhere Lodash runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install lodash.

✓ Stable · Lodash 4.0+

_.concat()

Available in [email protected] full builds and the lodash/concat modular import. Works in evergreen browsers and current Node LTS when Lodash is installed.

100% With Lodash 4.x
Google Chrome Supported · Desktop & Mobile
Full support
Mozilla Firefox Supported · Desktop & Mobile
Full support
Apple Safari Supported · macOS & iOS
Full support
Microsoft Edge Supported · Chromium
Full support
Internet Explorer No native support · Use a polyfill
Polyfill
Opera Supported · Modern versions
Full support
Samsung Internet Supported · Android
Full support
Bun Supported · JavaScript runtime
Supported
Deno Supported · JavaScript runtime
Supported
Node.js Supported · Server runtime
Supported
Android WebView Supported · Modern WebView
Full support
_.concat Lodash 4.0+

Bottom line: Safe for production once Lodash is loaded. Prefer import concat from "lodash/concat" for smaller builds. Not a native browser API — load Lodash first (or use Array.prototype.concat).

Frequently Asked Questions

_.concat(array, …values) creates a new array by joining the first array with any extra values and/or arrays. Array arguments contribute their elements one level deep. The original array is not changed.
No. It returns a new array. The source you pass as the first argument stays the same.
An array argument spreads one level. So _.concat([1], 2, [3], [[4]]) yields [1, 2, 3, [4]] — the inner [4] stays as one element.
They follow the same one-level flattening idea. Lodash offers a stable functional API and works well with modular imports.
No. Object references are copied shallowly — the same instances appear in the new array.
Use import concat from "lodash/concat" or require("lodash/concat") for tree-shaking. Full build: import _ from "lodash" then _.concat.

Next: _.difference()

Find values present in one array but not in others.

_.difference() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful