Max value in array, based on a function
<p>I have an array of objects. I want to find the "maximum" of this array based on a function that returns whichever object is bigger when given 2 objects.</p>

<pre><code>function comparison(first, second) {
    // ... arbitrary comparison based on properties...
    return first; // or second
}

var a = [obj1, obj2, obj3];
var maxObj = ????(comparison);
</code></pre>

<p>What do I fill in here? What's elegant and short?</p>
