Math._average = function (array) {
var result = 0, index = 0;
for (index in array) {
result = result + array[index];
}
return result / array.length;
};
console.log(Math._average([2, 4, 8]));
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.