---
name: "BIS_fnc_arrayPush"
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_arrayPush
revid: 327182
updated: 2022-07-12T22:09:49Z
---

# BIS_fnc_arrayPush

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

## Description

This function adds an element to the end of an array and returns the array.

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

> [!NOTE]
> **Arma 3:** Use [append](../commands/append.md) or [pushBack](../commands/pushBack.md) instead.

## Syntax

```sqf
[array, element] call BIS_fnc_arrayPush
```

**Parameters:**

- `array`: [Array](../topics/Array.md)
- `element`: [Anything](../topics/Anything.md)

**Returns:** [Array](../topics/Array.md) - modified *array*

## Examples

### Example 1

```sqf
_newArray = [[0,1,2], 3] call BIS_fnc_arrayPush; // _newArray is [0,1,2,3]
```

### Example 2

```sqf
private _array = [0,1,2]; [_array, [3]] call BIS_fnc_arrayPush; // _array is [0,1,2,[3]]
```

## See also

[append](../commands/append.md) · [pushBack](../commands/pushBack.md) · [BIS_fnc_arrayPushStack](../functions/BIS_fnc_arrayPushStack.md)

<sub>Source: [BI Community Wiki — BIS fnc arrayPush](https://community.bistudio.com/wiki/BIS_fnc_arrayPush) (revision 327182).</sub>
