function _max(array) {
    var max;
    deepForEach(array, function (value) {
      try {
        if (isNaN(value) && typeof value === 'number') {
          max = NaN;
        } else if (max === undefined || larger(value, max)) {
          max = value;
        }
      } catch (err) {
        throw improveErrorMessage(err, 'max', value);
      }
    });

    if (max === undefined) {
      throw new Error('Cannot calculate max of an empty array');
    }

    return max;
  }
Recursively calculate the maximum value in an n-dimensional array
@param {Array} array
@return {number} max
@private