# prepend

Inserts an element at the start of a list.

```tql
prepend(xs:list, x:any) -> list
```

## Description

The `prepend` function returns the list `xs` with `x` inserted at the front. The expression `xs.prepend(y)` is equivalent to `[x, ...xs]`.

## Examples

### Prepend a number to a list

```tql
from {xs: [1, 2]}
xs = xs.prepend(3)
```

```tql
{xs: [3, 1, 2]}
```

## See Also

* [`add`](https://preview.docs.tenzir.com/375/375/reference/functions/add.md)
* [`append`](https://preview.docs.tenzir.com/375/375/reference/functions/append.md)
* [`concatenate`](https://preview.docs.tenzir.com/375/375/reference/functions/concatenate.md)
* [`remove`](https://preview.docs.tenzir.com/375/375/reference/functions/remove.md)
* [Shape lists](https://preview.docs.tenzir.com/375/375/guides/transformation/shape-lists.md)