build/rekord.js
function(comparator, startingValue)
  {
    var cmp = createComparator( comparator || this.comparator, true );
    var max = startingValue;

    for (var i = 0; i < this.length; i++)
    {
      if ( cmp( max, this[i] ) < 0 )
      {
        max = this[i];
      }
    }

    return max;
  }
function(comparator, startingValue)
  {
    var cmp = createComparator( comparator || this.comparator, true );
    var max = startingValue;

    for (var i = 0; i < this.length; i++)
    {
      if ( cmp( max, this[i] ) < 0 )
      {
        max = this[i];
      }
    }

    return max;
  }
function ( comparator , startingValue ) { var cmp = createComparator ( comparator || this . comparator , true ) ; var max = startingValue ; for ( var i = 0 ; i < this . length ; i ++ ) { if ( cmp ( max , this [ i ] ) < 0 ) { max = this [ i ] ; } } return max ; }
Returns the element with the maximum value given a comparator.

```javascript
var c = Rekord.collect({age: 4}, {age: 5}, {age: 6}, {age: 3});
c.maxModel('age'); // {age: 6}
c.maxModel('-age'); // {age: 3}
```

@method
@memberof Rekord.Collection#
@param {comparatorInput} comparator -
The comparator which calculates the maximum model.
@param {Any} [startingValue] -
The initial maximum value. If a value is specified, it's compared
against all elements in this collection until the comparator function
finds a more maximal value. If it doesn't - this is the value returned.
@return {Any} -
The maximum element in the collection given the comparator function.
@see Rekord.createComparator
Returns the element with the maximum value given a comparator .