max
arrayFinds the maximum value in an array
Syntax
max(array) Parameters
array (array) The array to find the maximum value from
Returns
number The maximum value in the array
Examples
Input:
[5, 2, 8, 1] | max Output:
8 Input:
[100, 50, 75] | max Output:
100 The max() function finds and returns the maximum value from an array of numbers. It compares all elements and returns the largest value.
Usage
This function is useful for finding the highest price, latest date, largest quantity, or any other maximum value in a dataset.