---
name: "pushBack"
type: command
status: ok
groups: ["Arrays"]
arma3_since: "1.26"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/pushBack
revid: 377141
updated: 2026-01-01T10:30:59Z
---

# pushBack

*Command · Arrays · Arma 3 v1.26*

## Description

Insert an element to the back of the given array. This command modifies the original array. (see also: [pushBackUnique](../commands/pushBackUnique.md))

## Syntax

```sqf
array pushBack element
```

**Parameters:**

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

**Returns:** [Number](../topics/Number.md) - index of inserted element

## Examples

### Example 1

```sqf
_arr = [1,2,3];
_arr pushBack 4;
hint str _arr; //[1,2,3,4]
```

### Example 2

```sqf
_arr = [1,[2,4],3];
(_arr select 1) pushBack [5,6];
hint str _arr //[1,[2,4,[5,6]],3]
```

## See also

[pushBackUnique](../commands/pushBackUnique.md) · [select](../commands/select.md) · [set](../commands/set.md) · [resize](../commands/resize.md) · [reverse](../commands/reverse.md) · [count](../commands/count.md) · [find](../commands/find.md) · [in](../commands/in.md) · [forEach](../commands/forEach.md) · [deleteAt](../commands/deleteAt.md) · [deleteRange](../commands/deleteRange.md) · [append](../commands/append.md) · [sort](../commands/sort.md) · [arrayIntersect](../commands/arrayIntersect.md) · [apply](../commands/apply.md) · [BIS_fnc_arrayPushStack](../functions/BIS_fnc_arrayPushStack.md) · [BIS_fnc_arrayPush](../functions/BIS_fnc_arrayPush.md)

## Community notes

**ffur2007slx2_5** — 2014-08-01

(A3 1.26) It is recommended to use [pushBack](../commands/pushBack.md) instead of [BIS_fnc_arrayPush](../functions/BIS_fnc_arrayPush.md).

```sqf
_array = [1,2,3];
_array pushBack 4; //same as [_array, 4] call BIS_fnc_arrayPush;
```

---

**Skaronator** — 2014-08-23

It's highly recommended to use the new [pushBack](../commands/pushBack.md) command, up to 43% faster than [set](../commands/set.md) and up to **11843%** faster a plus b!

---

**DreadedEntity** — 2014-11-26

[pushBack](../commands/pushBack.md) does not support [nil](../commands/nil.md) while [set](../commands/set.md) and a plus b do. For example:

```sqf
_array = [];
for "_i" from 0 to 3 do
{
    _array pushBack nil;
};
hint str _array; //hint is []
```

---

**Killzone_Kid** — 2015-05-21

Array "push" implementation using [pushBack](../commands/pushBack.md), alternative to [BIS_fnc_arrayPush](../functions/BIS_fnc_arrayPush.md)

```sqf
KK_fnc_push = {
    _this select 0 pushBack (_this select 1);
    _this select 0
};

// Example
arr = [1,2,3];
[arr, 4] call KK_fnc_push; //both arr and return of function are now [1,2,3,4]
```

---

**OOKexOo** — 2016-10-05

Note that [pushBack](../commands/pushBack.md) does not create a new object.

Therefore, if you edit an object that was pushed back to an array, it also affects the object in the array.
e.g.

```sqf
_first_squence = [1,2,3];
_second_squence = [5,4];

_first_squence pushBack _second_squence;
systemChat str _first_squence // prints [1,2,3,[5,4]]]

reverse _second_squence;
systemChat str _first_squence // prints [1,2,3,[4,5]]]
```

If you pushBack an array for instance, you can just copy it to generate a new object.
e.g.

```sqf
_first_squence pushBack +_second_squence;
```

<sub>Source: [BI Community Wiki — pushBack](https://community.bistudio.com/wiki/pushBack) (revision 377141).</sub>
