function arrayAvg(array) {
  if (!array.length) {
    return 0;
  }

  return arraySum(array) / array.length;
}
Calculate average value for each item of the array.

@param {Array} array The array to process.
@returns {Number} Returns calculated average value.