> 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/intersection.md).

# \_.intersection（数组交集）

**语法：**

```javascript
_.intersection([arrays])
```

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

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

**描述：**

创建唯一值的数组，这个数组包含所有给定数组都包含的元素，使用[`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)进行相等性比较。

> 可以理解为给定所有数组的交集

**开始版本：**&#x30;.1.0

**参数：**

* `array (Array)`: 需要检查的数组。

**返回值：**

* `array (Array)`: 返回一个包含所有传入数组交集元素的新数组。

**例子：**

```javascript
_.intersection([2, 1], [2, 3]);
// => [2]
```
