jon j
2012-06-18 20:07:49 UTC
and return their average.
. Write a function, getMax, that will accept a variable number of numeric arguments
and return the maximum value passed to it.
. Write a function, getMin, that will accept a variable number of numeric arguments
and return the minimum value passed to it.
here is what i have but when i took it to expression it doesnt work function getAvg() {
var avg = 0;
for(var i=0; i
}
return avg / arguments.length;
}
function getMax(vars) {
return Math.max.apply(Math, vars);
}
function getMin(vars) {
return Math.min.apply(Math, vars);
}
function getMax(vars) {
return Math.max.apply(Math, vars);
}
function getMin(vars) {
return Math.min.apply(Math, vars);
}
getAvg(112, 252, 309, 14, 658) =