 <p>Use <a href="https://lodash.com/docs#orderBy" rel="nofollow"><code>orderBy</code></a> with with <code>order</code> ascending or descending to decide if lowest or highest. Group by <code>custormerId</code>, and take the 1st item from each customer orders:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>function getMinMax(orders, min) { // orders - array of orders, min - true if minimum, undefined / false if maximum var order = !!min ? 'asc' : 'desc'; return _(orders) .orderBy('orderAmount', order) // orderBy the orderAmount property, with order determining highest or lowest .groupBy('customerId') // group all orders by customer id .map(function(orders) { // create a new array of just the 1st order of each customer, which will be the highest or the lowest return orders[0]; }).value(); } var orders = [{ customerId: 1, orderId: '1-1', orderAmount: 100 }, { customerId: 2, orderId: '1-2', orderAmount: 128 }, { customerId: 2, orderId: '1-3', orderAmount: 12 }, { customerId: 1, orderId: '1-3', orderAmount: 113 }, { customerId: 2, orderId: '1-1', orderAmount: 125 }, { customerId: 2, orderId: '4-1', orderAmount: 11 }, { customerId: 1, orderId: '1-2', orderAmount: 25 }]; var highestOrders = getMinMax(orders); console.log('highestOrders', highestOrders); var lowesetOrders = getMinMax(orders, true); console.log('lowesetOrders', lowesetOrders);</code></pre> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.14.2/lodash.min.js"&gt;&lt;/script&gt;</code></pre> </div> </div> </p>