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

# every

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

## every(Array<T>, (T) -> Boolean): Boolean

Returns `true` if every element in the array matches the condition.

The function stops iterating after the first negative evaluation of an element in the array.

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>list</code></p></td><td><p>The input array.</p></td></tr><tr><td><p><code>condition</code></p></td><td><p>A condition (or expression) to apply to elements in the input array.</p></td></tr></tbody></table>

### Example

This example applies a variety of expressions to the input arrays. The `$` references values of the
elements.

#### Source

```DataWeave
%dw 2.0
import * from dw::core::Arrays
var arr0 = [] as Array<Number>
output application/json
---
{ "results" : [
     "ok" : [
        [1,1,1] every ($ == 1),
        [1] every ($ == 1)
     ],
     "err" : [
        [1,2,3] every ((log('should stop at 2 ==', $) mod 2) == 1),
        [1,1,0] every ($ == 1),
        [0,1,1,0] every (log('should stop at 0 ==', $) == 1),
        [1,2,3] every ($ == 1),
        arr0 every true,
     ]
   ]
 }
```

#### Output

```JSON
{
   "results": [
     {
       "ok": [ true, true ]
     },
     {
       "err": [ false, false, false, false, true ]
     }
   ]
 }
```

## every(Null, (Nothing) -> Boolean): Boolean

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

_Introduced in DataWeave 2.3.0. Supported by Mule 4.3 and later._
