Skip to content

union ​

js
_.union([arrays])

按顺序从所有给定数组中创建唯一值数组,使用 SameValueZero 进行相等性比较。

¥Creates an array of unique values, in order, from all given arrays using SameValueZero for equality comparisons.

新增于 ​

¥Since

0.1.0

参数 ​

¥Arguments

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

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

返回 ​

¥Returns

(数组):返回新的组合值数组。

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

示例 ​

¥Example

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

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