# append

Source: https://taxilang.org/docs/language/stdlib/append

**Full name:** `taxi.stdlib.append`

## Signature

```taxi
declare extension function <T> append(array1: T[], array2: T[]):T[]
```

## Description

Returns a new collection containing the elements of the first array followed by the elements of the second array.

Neither input array is modified.

```taxi
find { cart: ShoppingCart } as {
   allItems: cart.regularItems.append(cart.saleItems)
}
```

## Examples

Concatenates two arrays, returning a new array with elements of the first followed by elements of the second.

Schema:

```taxi
model Bag {
   items: String[]
}
```

Query:

```taxi
given {
   bag1: Bag = { items: ['apple', 'banana'] },
   bag2: Bag = { items: ['cherry', 'date'] }
}
find {
   combined: String[] = bag1.items.append(bag2.items)
}
```

Result:

```json
{
  "combined": [
    "apple",
    "banana",
    "cherry",
    "date"
  ]
}
```
