# max

## Description

Returns the largest value of the numbers in the passed array.

## Input / Parameter

| Name  | Description                                           | Input Type | Default | Options | Required |
| ----- | ----------------------------------------------------- | ---------- | ------- | ------- | -------- |
| value | The array of values to return the largest value from. | Array/List | -       | -       | Yes      |

## Output

| Description                             | Output Type |
| --------------------------------------- | ----------- |
| Returns the largest value in the array. | Number      |

## Example

In this example, we will get the biggest of the numbers in a list and print the result in the console.

### Step

1. Drag a `button` component to the canvas and open the `Action` tab. Select the `press` event of the button and drag the `Log.write` function to the event flow.
2. Call the function `List.max` inside the `Log.write` function.
3. Then call the function `Conversion.toList` inside the `List.max` function.
4. Enter the values of the list to find the max from.

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-9f047c3bc05b9580c1015c8250789d852c0bc230%2Fmax-step-1.png?alt=media)

### Result

1. The console will print the max value of the list.
2. In this example, the value printed will be `5`.

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-698df18f585a0f025bea220eaa40c8521d5808f6%2Fmax-result-1.png?alt=media)

## Links

### Related Information

See also:

* Functions
  * [Conversion.toList](https://github.com/OrangeKloud/emobiq-documentation/blob/master/document/client/2-5-actions-and-visual-logic/action-reference/react-native/Conversion/toList/toList.md)
