code: function max(array, byProperty) {
      if (!array || array.length === 0) return undefined;
      
      var i = array.length - 1, 
          result = byProperty ? array[i][byProperty] : array[i];
      if (byProperty) {
        while (i--) {
          if (array[i][byProperty] >= result) {
            result = array[i][byProperty];
          }
        }
      }
      else {
        while (i--) {
          if (array[i] >= result) {
            result = array[i];
          }
        }
      }
      return result;
    }
docs: Finds maximum value in array (not necessarily "first" one)
  @method max
  @memberOf fabric.util.array
  @param {Array} array Array to iterate over
  @param {String} byProperty