{"name":"BIS_fnc_arrayPush","title":"BIS fnc arrayPush","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_arrayPush","revid":327182,"updated":"2022-07-12T22:09:49Z","groups":["Arrays"],"status":"ok","games":{"arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"arma2 1.00","arma3_since":"0.50","description":"This function adds an element to the end of an array and returns the array.\n**The array is passed by reference** so changes inside the function will be reflected outside of it.\n\n> [!NOTE]\n> **Arma 3:** Use append or pushBack instead.","syntaxes":[{"syntax":"[array, element] call BIS_fnc_arrayPush","params":[{"name":"array","type":"Array","type_expr":"Array"},{"name":"element","type":"Anything","type_expr":"Anything"}],"returns":{"type":"Array","type_expr":"Array","description":"modified array","text":"Array - modified *array*"}}],"examples":[{"code":["_newArray = [[0,1,2], 3] call BIS_fnc_arrayPush; // _newArray is [0,1,2,3]"]},{"code":["private _array = [0,1,2]; [_array, [3]] call BIS_fnc_arrayPush; // _array is [0,1,2,[3]]"]}],"see_also":["append","pushBack","BIS_fnc_arrayPushStack"]}