union
Import from @varavel/vdl-plugin-sdk/utils/arrays.
Creates an array of unique values from all given arrays.
This function takes two arrays, merges them into a single array, and returns a new array containing only the unique values from the merged array.
Type Parameters
| Type Parameter | Description |
|---|---|
T |
The type of elements in the array. |
Parameters
| Parameter | Type | Description |
|---|---|---|
arr1 |
readonly T[] |
The first array to merge and filter for unique values. |
arr2 |
readonly T[] |
The second array to merge and filter for unique values. |
Returns
T[]
A new array of unique values.