Contact Free trial Login

max

max(Array<T>): T | Null

Returns the highest numeric value in a list (an array).

Returns null if the array is empty and produces an error when non-numeric values are in the array.

Example

This example returns the maximum value of each input array.

Source

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

Output

{
  "a": 1000,
  "b": 3,
  "d": 3.5
}