const averageOf Target Style export const averageOf = (values) => { Calculates the arithmetic mean with a more conversational name. Target style API. Preferred for new code. Parametersvaluesnumber[] Returnsnumber
const calculateAverage Legacy Style export const calculateAverage = (values) => averageOf(values) Calculates the arithmetic mean of numeric values. Legacy API. Kept for older code and not the preferred choice for new code. Parametersvaluesnumber[] Returnsnumber Exampleconst average = averageOf([10, 20, 30])