Returns the largest numeric value in an array. If the array parameter value is an empty array, returns zero. All elements must contain values that can be automatically converted to numeric values.
arrayMax(array)
returns numeric
someArray.max()
Name | Type | Required | Default | Description |
---|---|---|---|---|
array | array | Yes | An array or variable name |
To get the largest numeric value of an array
someArray = arrayNew(1);
writeOutput(arrayMax(someArray));
Uses the arrayMax function to get the largest numeric value of an array
someArray = [23,45,87,1,4];
writeOutput(arrayMax(someArray));
CF11+ Lucee4.5+
someArray = [23,45,0,1,4];
writeOutput(someArray.max());