intersection
Import from @varavel/vdl-plugin-sdk/utils/arrays.
Returns the intersection of two arrays.
This function takes two arrays and returns a new array containing the elements that are present in both arrays. It effectively filters out any elements from the first array that are not found in the second array.
Type Parameters
| Type Parameter | Description |
|---|---|
T |
The type of elements in the array. |
Parameters
| Parameter | Type | Description |
|---|---|---|
firstArr |
readonly T[] |
The first array to compare. |
secondArr |
readonly T[] |
The second array to compare. |
Returns
T[]
A new array containing the elements that are present in both arrays.