Warning: file_put_contents(/ff_d2af4c4c890c6f4d1a9f12e89f24eb8937ecc0836f802d94.php): failed to open stream: Permission denied in /home/ofpecsav/public_html/forum/Sources/Subs-ForumFirewall.php on line 1619
arrayIntersect - OFPEC Scripting Command Reference | OFPEC The Editing Center

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