docs: function avg(arr) {
      arr = arr || [];
      if (arr.length) {
          var total = sum(arr);
          if (number.isNumber(total)) {
              return total / arr.length;
          } else {
              throw new Error("Cannot average an array of non numbers.");
          }
      } else {
          return 0;
      }
  }