Copy as Markdown[Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fcoralogix.com%2Fdocs%2Fdataprime%2Flanguage-reference%2Ffunctions-reference%2Farray%2Farrayremoveat.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fcoralogix.com%2Fdocs%2Fdataprime%2Flanguage-reference%2Ffunctions-reference%2Farray%2Farrayremoveat.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)

# `arrayRemoveAt`

## Description

Returns a new array with the element at the specified position removed.

* The element type must match the array type.
* Supported element types include `string`, `bool`, `number`, `interval`, `timestamp`, `regexp`, and `enum`.
* Positions are **0-indexed**.

## Syntax

Like many functions in DataPrime, `arrayRemoveAt` supports<!-- --> [two notations](https://coralogix.com/docs/docs/dataprime/language-reference/functions-reference/.md),<!-- --> **function** and **method**. These interchangeable forms allow flexibility in how you structure expressions.

* Function notation
* Method notation

```
arrayRemoveAt(array: array<T>, position: number): array<T>
```

```
(array: array<T>).arrayRemoveAt(position: number): array<T>
```

## Arguments

| Name       | Type       | Required | Description                                    |
| ---------- | ---------- | -------- | ---------------------------------------------- |
| `array`    | `array<T>` | **true** | The array to modify                            |
| `position` | `number`   | **true** | The index of the element to remove (0-indexed) |

## Example

**Use case: Remove an item from a queue by position**

Suppose you have a list of jobs and want to remove the job at a specific position. Consider the following input:

```
{

    "values": ["Job 1", "Job 2", "Job 3", "Job 4"]

}
```

By removing the element at index `2`, the array will no longer include `"Job 3"`.

### Example query

* Function notation
* Method notation

```
replace values with arrayRemoveAt(values, 2)
```

```
replace values with values.arrayRemoveAt(2)
```

### Example output

The result will include the updated array without the element at that position:

```
{

    "values": ["Job 1", "Job 2", "Job 4"]

}
```
