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

# dropWhile

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

## dropWhile(Array<T>, (item: T) -> Boolean): Array<T>

Drops elements from the array while the condition is met but stops the selection process when it
reaches an element that fails to satisfy the condition.

_Introduced in DataWeave 2.2.0. Supported by Mule 4.2 and later._

### 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 array of elements.</p></td></tr><tr><td><p><code>condition</code></p></td><td><p>The condition (or expression) used to match an element in the array.</p></td></tr></tbody></table>

### Example

This example returns an array that omits elements that are less than or equal to `2`. The last two
elements (`2` and `1`) are included in the output array because the function stops dropping elements
when it reaches the `3`, which is greater than `2`.

#### Source

```DataWeave
%dw 2.0
import * from dw::core::Arrays
output application/json
var arr = [0,1,3,2,1]
---
arr dropWhile $ < 3
```

#### Output

```json
[3, 2, 1]
```
