cfdocs

arrayMedian

Calculates the Median value of items in an array. All elements in the array must contain values that can be converted to numeric.

arrayMedian(array)
returns numeric

Member Function Syntax

array.median()

Argument Reference

Name Type Required Default Description
array array Yes    

Calculates the Median value

Uses the arrayMedian function to calculate the Median value

someArray = [1,2,2];
m=arrayMedian(someArray);
writeOutput(m);

Expected Result: 2