---
name: "BIS_fnc_arrayShift"
type: function
status: ok
groups: ["Arrays"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_arrayShift
revid: 329366
updated: 2022-07-27T12:29:43Z
---

# BIS_fnc_arrayShift

*Function · Arrays · Arma 3 v0.50 · introduced in Arma 2 v1.00*

## Description

This function removes the first (leftmost) element of an array and returns it.

The array is passed by reference so changes inside the function will be reflected outside of it.

> [!NOTE]
> **Arma 3:** In Arma 3, use `array deleteAt 0`.

## Syntax

```sqf
[array] call BIS_fnc_arrayShift
```

**Parameters:**

- `array`: [Array](../topics/Array.md) - **NOTE:** given array must be within an array (e.g `[[10, 20, 30]] call BIS_fnc_arrayShift`)

**Returns:** [Anything](../topics/Anything.md) - the removed element

## Examples

### Example 1

```sqf
private _myArray = ["2", "report", "status"];
_removedElement = [_myArray] call BIS_fnc_arrayShift;    // array is -within an array-
_removedElement == "2";                                    // true
_myArray isEqualTo ["report", "status"];                // true
```

## See also

[deleteAt](../commands/deleteAt.md) · [pushBack](../commands/pushBack.md)

<sub>Source: [BI Community Wiki — BIS fnc arrayShift](https://community.bistudio.com/wiki/BIS_fnc_arrayShift) (revision 329366).</sub>
