# append ## Category Array ## Arity **Binary** — ` append `. ``` append ``` ## Description Appends all elements from the right-hand array into the left-hand array. This is a bulk operation — more efficient than repeated `pushBack` calls. No return value (void). ## How It Works Calls `List.AddRange()` on the underlying list. All elements from the source array are added in order. The source array is not modified. ## Usage ### Merge arrays ```sqf _arr1 = [1, 2, 3]; _arr2 = [4, 5, 6]; _arr1 append _arr2; // _arr1 is [1,2,3,4,5,6] ``` ### Collecting results ```sqf _allUnits = []; _allUnits append _infantry; _allUnits append _vehicles; _allUnits append _air; ``` ### Array concatenation helper ```sqf _concat = { params ["_a", "_b"]; _result = []; _result append _a; _result append _b; _result }; _combined = [_arr1, _arr2] call _concat; ``` ### vs pushBack ```sqf // Bad — many individual pushes { _target pushBack _x } forEach _source; // Good — single bulk append _target append _source; ``` ## Thread Safety **Not thread-safe**. Both arrays must belong to the current scheduler. ## See Also - [pushBack](pushBack.md) — append single element - [deleteRange](deleteRange.md) — remove range of elements - [resize](resize.md) — change array size - [select](select.md) — element access