---
schema_version: "1"
id: def77da1bcb6e74863b4dca8d915dde303dfd5e6f6df7da27d29f2981365c6b3
title: drop
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.4/dw-arrays-functions-drop.md
canonical_url: https://docs.mulesoft.com/dataweave/2.4/dw-arrays-functions-drop
source_site: docs.mulesoft.com
content_type: documentation
content_hash: d2399b30e50bd016e71c61ff1a0d748cb5a3f16c4f4ff72f11722145a9edbb5a
description: MuleSoft Documentation Site
release: "2.4"
latest: false
---
---
product: DataWeave
version: 2.4
---

# drop

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

## drop<T>(array: Array<T>, n: Number): Array<T>

Drops the first `n` elements. It returns the original array when `n <= 0` and an empty array when
`n > sizeOf(array)`.

_Introduced in DataWeave version 2.2.0._

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>array</code></p></td><td><p>The left array of elements.</p></td></tr><tr><td><p><code>n</code></p></td><td><p>The number of elements to take.</p></td></tr></tbody></table>

### Example

This example returns an array that only contains the third element of the input array. It drops the
first two elements from the output.

#### Source

```DataWeave
%dw 2.0
import * from dw::core::Arrays
var users = ["Mariano", "Leandro", "Julian"]
output application/json
---
drop(users, 2)
```

#### Output

```json
["Julian"]
```

## drop(array: Null, n: Any): Null

Helper function that enables `drop` to work with a `null` value.

_Introduced in DataWeave version 2.4.0._
