Warning: file_put_contents(/ff_71e41b3b6c9da44ee3b2dae2b6939f2d04b7ac73aca0f16e.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