function min(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;
  }
Finds minimum value in array (not necessarily "first" one)
@method min
@memberOf fabric.util.array
@param {Array} array Array to iterate over
@param {String} byProperty