---
updatedAt: 2025-05-20T20:28:14.000Z
agentTools:
  projectIndex: https://docs.documotor.com/llms.txt
---

# append

Add items to the end of an array

# Definition

`array[any] append(array[any] $array, any *$items)`

Appends `*$items` to the end of `$array` and returns the resulting array.

# Parameters

<Glossary>array</Glossary> `$array`

The array to be extended.

<Glossary>any</Glossary> `*$items`

Any amount of arguments of any type to be added to the end of the `$array`.

# Returns

<Glossary>array</Glossary>

The array with `$items` appended to the end of `$array`.

# Examples

```text Transformation
{
  a: append(`[]`, `0`),
  b: append(`[0]`, `"abc"`),
  c: append(`[0, "abc"]`, `null`),
  d: append(`[0, "abc", null]`, `[true, false]`),
  e: append(`[0, "abc", null]`, `true`, `false`),
  f: append(`1`, `[]`)              // Error
}
```

```json Result
{
  "a": [0],
  "b": [0, "abc"],
  "c": [0, "abc", null],
  "d": [0, "abc", null, [true, false]],
  "e": [0, "abc", null, true, false]
}
```