docs: function average(array) {
    var length = array.length;
  
    if (length === 0) {
      throw new RangeError("Error");
    }
  
    var index = -1;
    var result = 0;
  
    while (++index < length) {
      result += array[index];
    }
  
    return result / length;
  }