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

# max

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

## max(Array<T>): T | Null

Returns the highest `Comparable` value in an array.

The items must be of the same type, or the function throws an error. The function returns `null` if
the array is empty.

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>values</code></p></td><td><p>The input array. The elements in the array can be any supported type.</p></td></tr></tbody></table>

### Example

This example returns the maximum value of each input array.

#### Source

```DataWeave
%dw 2.0
output application/json
---
{ a: max([1, 1000]), b: max([1, 2, 3]), c: max([1.5, 2.5, 3.5]) }
```

#### Output

```JSON
{ "a": 1000, "b": 3, "c": 3.5 }
```
