Skip to content

intersection

js
_.intersection([arrays])

创建包含在所有给定数组中的唯一值数组,使用 SameValueZero 进行相等性比较。结果值的顺序和引用由第一个数组决定。

¥Creates an array of unique values that are included in all given arrays using SameValueZero for equality comparisons. The order and references of result values are determined by the first array.

新增于

¥Since

0.1.0

参数

¥Arguments

  1. [arrays] (...数组):要检查的数组。

    ¥[arrays] (...Array): The arrays to inspect.

返回

¥Returns

(数组):返回新的相交值数组。

¥(Array): Returns the new array of intersecting values.

示例

¥Example

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

Lodash v4.17 中文网 - 粤ICP备13048890号