> For the complete documentation index, see [llms.txt](https://lodash.shujuwajue.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lodash.shujuwajue.com/array/concat.md).

# \_.concat（连接）

**语法：**

```javascript
_.concat(array, [values])
```

**源代码链接：**[source](https://github.com/lodash/lodash/blob/4.17.10/lodash.js#L6911)

**npm包链接：**[npm package](https://www.npmjs.com/package/lodash.concat)

**描述：**

创建一个用任何数组 或 值连接的新数组。

**开始版本：**&#x34;.0.0

**参数：**

* `array (Array)`: 需要连接的数组。
* `[values] (...*)`:需要连接的值。

**返回值：**

* `array (Array)`: 返回连接后的新数组。

**例子：**

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

console.log(other);
// => [1, 2, 3, [4]]

console.log(array);
// => [1]
```

**注意，会返回一个新数组，并且不改变传入的数组。**

## 参考资料

* 源分析：[每天一个lodash方法-concat](https://segmentfault.com/a/1190000014049140)
