{"name":"BIS_fnc_arrayShift","operator":null,"title":"BIS fnc arrayShift","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_arrayShift","revid":329366,"updated":"2022-07-27T12:29:43Z","groups":["Arrays"],"status":"ok","replaced_by":[],"games":[{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma2","name":"Arma 2","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"This function removes the first (leftmost) element of an array and returns it.\n\nThe array is passed by reference so changes inside the function will be reflected outside of it.\n\n> [!NOTE]\n> **Arma 3:** In Arma 3, use `array deleteAt 0`.","syntaxes":[{"syntax":"[array] call BIS_fnc_arrayShift","since":null,"effect":null,"exec":null,"params":[{"name":"array","type":"Array","optional":false,"default":null,"description":"**NOTE:** given array must be within an array (e.g `[[10, 20, 30]] call BIS_fnc_arrayShift`)","types":["Array"],"since":null,"text":"array: Array - **NOTE:** given array must be within an array (e.g `[[10, 20, 30]] call BIS_fnc_arrayShift`)"}],"returns":{"type":"Anything","types":["Anything"],"description":"the removed element","text":"Anything - the removed element"}}],"examples":[{"text":"```sqf\nprivate _myArray = [\"2\", \"report\", \"status\"];\n_removedElement = [_myArray] call BIS_fnc_arrayShift;    // array is -within an array-\n_removedElement == \"2\";                                    // true\n_myArray isEqualTo [\"report\", \"status\"];                // true\n```","code":["private _myArray = [\"2\", \"report\", \"status\"];\n_removedElement = [_myArray] call BIS_fnc_arrayShift;\t// array is -within an array-\n_removedElement == \"2\";\t\t\t\t\t\t\t\t\t// true\n_myArray isEqualTo [\"report\", \"status\"];\t\t\t\t// true"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["deleteAt","pushBack"],"notes":[],"categories":["Arma 2: Functions","Arma 2: New Functions","Arma 2: Operation Arrowhead: Functions","Arma 3: Functions","Function Group: Arrays","Functions","Introduced with Arma 2 version 1.00","Take On Helicopters: Functions"],"docblock":null,"filled_from_docblock":[]}