a arrayIntersect b

Operand types

a: Array
b: Array

Type of returned value

Description

Intersects array A with array B returning array of unique common elements.

Additionally, using the same array for array A and array B will simply return array of unique elements.

Used In

Arma3

Example

_arr1 = [1,2,3,4,5,2,3,4];
_arr2 = [4,5,6,1,2,3,5,6];
hint str (_arr1 arrayIntersect _arr2); //[4,5,1,2,3]

_arr = [1,2,3,1,2,3,1,2,3,4,5];
hint str (_arr arrayIntersect _arr); //[1,2,3,4,5]

hint str ([1,2,nil,3] arrayIntersect [1,2,nil,3]); //[1,2,3]

Advertisement